Chelsea produced a dramatic late show at Cardiff to keep their Champions League hopes alive with a controversial 2-1 victory.
Victor Camarasa swept Cardiff ahead with a delicious volley straight after the restart, before Chelsea scored twice in the final six minutes through Cesar Azpilicueta and substitute Ruben Loftus-Cheek.
The win moves Chelsea to within one point of fourth-placed Manchester United, but Azpilicueta's equaliser was mired in controversy as he looked two yards offside when heading in after Marcos Alonso had flicked on Willian's corner.
Cardiff were also furious that Antonio Rudiger escaped a red card for dragging down Kenneth Zohore moments later with the striker breaking through on goal.
Rudiger was only shown a yellow card by referee Craig Pawson, but there was worse to come for Cardiff when Loftus-Cheek beat Lee Peltier to Willian's deep cross to head home in the first of four minutes of stoppage time.
The result is particularly painful for a Cardiff side who had looked like ending a run of 16 successive Premier League defeats against sides currently in the top six.
Wins for Burnley and Southampton on Saturday had opened the gap on the Bluebirds in the final relegation place to five points and they are fast running out of time to stay in the Premier League.
Before the late rescue act, Chelsea had been awful and the travelling fans had called for the dismissal of manager Maurizio Sarri.
Sarri's day was also laced with questionable selection as Eden Hazard and N'Golo Kante were dropped to the bench. Callum Hudson-Odoi was again deprived of making his first Premier League start after impressing for England in Montenegro on Monday.
The result was slow and ponderous build-up play as a three-man attack of Pedro, Gonzalo Higuain and Willian - who have all turned 30 - lacked the energy to trouble one of the division's leakiest defences.
A forgettable first half had only brief interludes of action, with Willian attempting to inject some urgency by moving off the left flank and into a central position.
The Brazilian laid the ball back into Pedro's path but Neil Etheridge in the Cardiff goal was untroubled from 25 yards.
Cardiff's response was immediate as Harry Arter set up Josh Murphy for a curling effort which flew two yards wide of Kepa Arrizabalaga's far post.
The elusive Murphy was just about the best individual on show and Jorginho collected a yellow card for hauling down the winger.
Peltier sent his half-volley straight at Kepa and Sean Morrison wanted a penalty when Alonso grabbed a chunk of his shirt from a Cardiff corner.
Willian was Chelsea's best bet for an opening goal, sending a 25-yard free-kick just off target and then almost setting up Alonso from a clever short-corner routine.
The game was crying out for Hazard's arrival, but there was no sign of the Belgian after the break and Cardiff were ahead within 52 seconds of the restart.
Arter swung over a cross after Aron Gunnarsson's long throw had been cleared back to the Iceland midfielder.
Camarasa met the low dipping ball on the volley to beat Kepa from 15 yards for his fifth goal of the season.
"We want Sarri out," chanted the Chelsea fans as the manager responded with an overdue susbstitution, replacing Pedro with Hazard after 53 minutes.
The switch changed the direction of the game. Hazard brought finesse to Chelsea as Mateo Kovacic fired over from 25 yards and the Belgian himself was crowded out in a congested goalmouth.
Willian whistled another shot wide before growing Chelsea pressure brought joy that the visitors - and Sarri - barely deserved and left Cardiff seething.