Danny Ward was Cardiff's late-goal hero as they boosted their play-off hopes with a 1-0 win over Bristol City, who sacked Lee Johnson shortly after the full-time whistle.
The substitute ran on to a through ball from fellow replacement Lee Tomlin to slot a left-footed shot past Dan Bentley after poor control from City sub Benik Afobe had surrendered possession.
For the Robins, it meant nine games without a win - and four straight defeats since the season's resumption last month - and the result almost certainly ended already flickering play-off hopes.
Johnson recalled Tomas Kalas in place of suspended defender Ashley Williams and also brought in Famara Diedhiou to add a physical presence up front in a 4-4-2 formation.
Cardiff boss Neil Harris also made changes, giving starts to Will Vaulks and Callum Paterson, while naming three ex-Robins players, Marlon Pack, Aden Flint and Tomlin on the bench.
The visitors had the better of a poor quality first half, getting their front men into the game more than the Robins.
But it was the hosts who launched the first meaningful attack after five minutes when a Nahki Wells header and a follow-up shot from Kalas were blocked.
Nathaniel Mendez-Laing had a 10th-minute shot deflected wide for Cardiff before Zak Vyner's tame header was easily saved by Alex Smithies at the other end.
A Joe Ralls corner in the 21st minute caused havoc in the hosts' goalmouth before the ball was cleared and it was Cardiff looking the more threatening side.
Their best first-half chance fell to Ralls after 37 minutes, but his low shot was blocked.
The same applied to Mendez-Laing's effort on the rebound and when Andreas Weimann gave the ball away, Junior Hoilett also saw his shot ricocheted off a defender.
There was a moment of anxiety for Cardiff at the start of second half when goalkeeper Smithies had his attempted clearance charged down by Wells, but the ball bounced across the goal rather than into it.
Home goalkeeper Bentley had to make the first meaningful save after 53 minutes, tipping a Vaulks shot over the crossbar after good work by Hoilett.
Jay Dasilva's shot was well blocked by Curtis Nelson after a rare Robins raid and it took a fine Smithies save to palm wide a Wells volley.
After both teams had used their first substitute, Johnson made a triple change with 20 minutes left, sending on Afobe, Filip Benkovic and Jack Hunt for Wells, Callum O'Dowda and Vyner.
Benkovic should have put Bristol City ahead with nine minutes left, rising to meet Jamie Paterson's corner but putting his header wide.
Neither side wanted to settle for a point and the game became wide open. After Ward's goal broke the deadlock, the hosts threw even more men forward. There were chances at both ends, but Cardiff held on to clinch a massive third straight away win.
Bristol City: Bentley; Vyner (Hunt 70), Kalas, Baker, Dasilva; Weimann (Paterson 57), Smith, Nagy, O'Dowda (Benkovic 70); Wells (Afobe 70), Diedhiou
Subs: Wollacott, Watkins, Hinds, Rowe, Massengo
Cardiff City: Smithies; Sanderson, Nelson, Morrison, Bennett; Vaulks, Bacuna, Ralls; Mendez-Laing (Tomlin 66), Paterson (Ward 79), Hoilett (Bamba 89)
Subs: Etheridge, Flint, Smith, Pack, Whyte, Murphy
Referee: Tim Robinson