Wayne Rooney’s Rams twice came from behind to secure a vital 3-3 draw against Wednesday at Pride Park and escape the drop at the expense of their opponents.
Martyn Waghorn’s double – including a decisive 78th-minute penalty – and a strike from Patrick Roberts saved the Rams, with goals from Sam Hutchinson, Callum Paterson and Julian Borner keeping the Owls in contention until the whistle.
A late winner for Wednesday would have reversed the clubs’ fortunes.
Rotherham had looked set to survive for much of the afternoon and would have done so had they not conceded an 88th-minute equaliser to draw 1-1 at Cardiff.
Marlon Pack’s late strike broke Millers’ hearts after Paul Warne’s men squandered numerous chances to add to Lewis Wing’s superb early opener.
Meanwhile, Wycombe went down with a fight, winning 3-0 at Middlesbrough having required a mathematical miracle to stay up.
Fred Onyedinma, Garath McCleary and Jason McCarthy were on target for Gareth Ainsworth’s Chairboys, who were reliant on favours from elsewhere and an unrealistic goal difference swing to prevent an immediate return to the third tier.
That impressive win at the Riverside Stadium meant Wednesday finished bottom of the table, with a six-point deduction for breaching financial rules ultimately proving pivotal.
Meanwhile, Derby, who began a tumultuous season under Phillip Cocu before Rooney took over, finished just a single point above Wycombe to avoid falling into the third tier for the first time since 1992.
In the play-off picture, Brentford will face Bournemouth with Swansea set to take on Barnsley.
The Bees, who had already guaranteed third place, won 3-1 at Bristol City thanks to Ivan Toney’s 31st goal of the season plus strikes from Bryan Mbeumo and Sergi Canos, while Louis Britton scored for the Robins.
Swansea clung on to fourth spot despite goals from Andre Gray and Isaac Success condemning them to a 2-0 loss at promoted Watford.
Premier League-bound Norwich lifted the Championship trophy at Barnsley but missed out on setting a new club record of 30 wins in a league season following a 2-2 draw.
Daniel Farke’s Canaries twice came from behind to claim a point at Oakwell, with Emi Buendia and substitute Adam Idah wiping out goals from Tykes pair Cauley Woodrow and Conor Chaplin.
Bournemouth will go into the play-offs on the back of three successive defeats after goals from debutant Will Forrester and Tommy Smith eared Stoke a 2-0 success on the south coast.
Elsewhere, Adam Armstrong’s hat-trick helped Blackburn end the season with a resounding 5-2 win over Birmingham.
Ben Brereton and Harvey Elliott were also on target for Rovers, while Blues were level at 2-2 for a spell in the second half courtesy of Kristian Pedersen and Lukas Jutkiewicz.
Coventry also signed off in style, thumping Millwall 6-1 thanks to goals from Jordan Shipley, Kyle McFadzean, Dominic Hyam, Callum O’Hare, Matty James and Tyler Walker. A McFadzean own goal provided the Lions’ scant consolation.
Preston came from behind to win 2-1 at Nottingham Forest as Tom Bayliss and Liam Lindsay overturned James Garner’s long-range opener.
Huddersfield escaped with a 2-2 draw at Reading thanks to an injury-time goal from Rarmani Edmonds-Green. Michael Olise’s penalty and a goal from Yakou Meite had put the Royals ahead following Josh Koroma’s free-kick opener.
In Saturday’s other game, QPR won 3-1 at home to Luton. Albert Adomah’s late strike added to earlier goals from Charlie Austin and Stefan Johansen for the Hoops, with Kiernan Dewsbury-Hall scoring for the Hatters.