Marlon Pack’s late equaliser broke Rotherham hearts to send them back down to League One, but spared Wayne Rooney’s blushes as Derby survived on a dramatic final day.
Lewis Wing’s stunning volley looked as if it was going to be enough to seal Championship safety for the Millers while the Rams and Sheffield Wednesday battled it out at Pride Park.
Paul Warne’s men would have survived if they had turned their domination into goals, but they left the door open for Pack to snatch a late equaliser that meant they returned to the third tier after a chaotic final day.
Millers manager Warne handed Florian Jozefzoon the task of relegating his parent club.
The Rams forward, who joined the Yorkshire side on loan at the start of the season, knew victory in the Welsh capital could spell disaster for Wayne Rooney and his Derby colleagues.
The Suriname international started as part of an attacking front three, while Angus MacDonald slotted in at centre-back in place of Daniel Barlaser.
There was a welcome return to the Cardiff City bench for Sol Bamba, who was back in the fold after undergoing his final course of chemotherapy in his ongoing battle with cancer.
Lee Tomlin also featured on the bench for the first time under Mick McCarthy, who named an unchanged starting side following their 4-0 triumph at Birmingham.
The Millers, desperate to seal Championship survival, were given lift-off by a stunning strike from Wing.
Wes Harding’s cross was headed away from the Cardiff box by Perry NG, but Wing advanced towards the high, floating clearance and unleashed a fierce volley from 25 yards out that beat Dillon Phillips to his left for an invaluable lead.
Rotherham had a string of chances to pile even more pressure on Derby and Sheffield Wednesday.
First captain Richard Wood headed wide from a corner before Matt Crooks sliced a shot wide after latching onto a cross from strike partner Michael Smith.
Angus MacDonald also had a shot cleared off the line, but despite their total domination, the visitors were unable to give themselves another relegation lifeline as the first half ended 1-0.
McCarthy read his Cardiff players the riot act at half-time as they came out firing in the second-half.
Kieffer Moore fired over three minutes into the second period before being denied by some heroic defending from Wood.
The Rotherham bench were cheering every tackle, block, and refereeing decision, but their enthusiasm waned after news filtered through of Martyn Waghorn’s leveller at Pride Park.
Still, Smith pushed to make it 2-0 when he forced a save from a tight angle, but their efforts looked as if they were paling into insignificance when Patrick Roberts put Derby ahead.
The director’s box went wild when Callum Paterson equalised for the Owls to put Rotherham back in the driving seat.
But as events unfolded across the border, there was still one twist left in the tale at the Cardiff City Stadium.
The hosts marched forward and found Pack with the space to drill a low strike into the bottom corner, meaning their great fight for survival fell short.