A mistake from Wayne Rooney gifted Cardiff City a huge victory in their Championship play-off bid, as they effectively ended Derby County's hopes of gate-crashing the top six with a 2-1 win in the Welsh capital.
The crucial moment came just before the hour mark when England's record scorer dallied in possession and was dispossessed by Lee Tomlin, who raced clear and scored Cardiff's winner.
The visitors were the architects of their own downfall having also gifted Cardiff the lead when Jason Knight's awful back-pass was intercepted by Junior Hoilett, who calmly rolled the ball into the net in the first half.
Knight made amends with a thumping finish to level after a super Derby break, but then came the blunder from player-coach Rooney.
The win means Cardiff remain sixth and with their play-off hopes in their own hands, while Derby are six points adrift and - barring an extraordinary run of results - consigned to another season outside the top flight.
Both sides knew this contest could essentially end up defining their season, such are the fine margins with just six further points available as the Championship campaign comes to its late conclusion.
After making fast starts after the resumption of the campaign, both the Bluebirds and Rams were coming into this contest on the back of successive losses, knowing that a third defeat on the spin would potentially be a play-off destroying result. The Rams, especially, simply had to win.
Cardiff maintained sixth spot thanks to Leeds United's last-gasp win at Swansea City at the weekend, three points ahead of Tuesday night's visitors Derby, and they started the brighter side with the recalled Tomlin finding space and pulling strings.
Derby goalkeeper Ben Hamer, who came under fire from some Rams fans following their 3-1 loss to Brentford last time out, was replaced by Kelle Roos and it was from uncertainty in Derby's defence that Cardiff were gifted an opener.
Roos was exceptionally unlucky to be breached after just 16 minutes with the first chance of the contest after a horror moment from Knight, whose dreadful back-pass was intercepted by Hoilett who kept his composure to round the goalkeeper and slide into the empty goal.
But Roos then justified his selection with a brilliant stop to deny Tomlin from close range, after a rampaging Cardiff-counter-attack saw Nathaniel Mendez-Laing set Tomlin clear, only for the goalkeeper to smother.
Derby were struggling to test Cardiff, but after 30 minutes they produced a pulsating counter-attack to draw level.
Louie Sibley was the architect, driving forward and cleverly sliding the ball to Knight, who smashed home to atone for his earlier error.
The Rams improved after their equaliser but it was the hosts who were closest to going into the interval ahead when Hoilett's fabulous curling effort was brilliantly tipped behnd by Roos.
The keeper was also alert to the danger soon after when Tomlin danced his way through the Derby defence.
The Rams started the second half positively and might have gone ahead straight from the restart as Sibley's stinging effort was tipped behind by Alex Smithies.
However, Rooney then gifted Cardiff what proved to be the deciding goal as he failed to beat Tomlin after taking a short pass from Matt Clarke, with Tomlin able to go clear and create the angle to beat Roos.
The Bluebirds then contentedly allowed Derby possession as they cannily looked to break at speed, with the onus totally on the visitors to find a way back into things.
Both Mendez-Laing and Robert Glatzel failed to find the target on the counter-attack as Derby threw men forward, but in truth never really looked like levelling and only even threatened from a late Rooney freekick that missed the target.
Cardiff should have wrapped things up when sub Danny Ward found space and picked out Joe Ralls who saw his header smash back off the crossbar, before Mendez-Laing shot straight at Roos.
Cardiff City: Smithies; Bacuna, Nelson, Morrison, Bennett; Pack (Paterson 90), Ralls; Mendez-Laing (Smith 90), Tomlin (Vaulks 70), Hoilett; Glatzel (Ward 78).
Subs: Etheridge, Sanderson, Flint, Bamba, Murphy.
Derby County: Roos; Lowe (Bogle 68), Davies, Clarke, Forsyth (Malone 88); Bird (Shinnie 88), Rooney; Knight (Marriott 77), Sibley (Jozefzoon 77), Lawrence; Martin.
Subs: Hamer, Evans, Buchanan, Whittaker.