SUBSTITUTE Bobby Zamora handed QPR a parting gift worth an estimated £120million when his final-minute goal in what will probably be his last game for the London club fired them back into the Premier League.
Harry Redknapp's side looked destined to spend a second season in the Championship when Gary O'Neil was sent off after an hour, with Derby well on top.
The manager admitted even he had given up hope before Zamora, who hit a play-off winner for West Ham in 2005, broke the hearts of Steve McClaren's men. "We were maybe trying to take the game to penalties with a draw and were hanging on for our lives," Redknapp said.
"It was a fantastic goal to win the game and I couldn't be more pleased. I would be a liar if I said I thought I would see us scoring. They had 11 men, were probing us and we were hanging on."
All the pressure was on Rangers, £177 million in debt and with a wage bill bigger than Atletico Madrid's, and it showed.
Derby bossed the first half, with former Dundee midfielder Craig Forsyth heading a deep cross from Jamie Ward narrowly wide, while Will Hughes blazed over from the edge of the area.
Rangers' hearts were in the mouths in the 27th minute when Hughes turned inside Richard Dunne in the area and promptly fell to the ground, but referee Lee Mason waved away Derby's appeals for a penalty.
Niko Kranjcar, the man who helped hasten McClaren's England exit with a goal for Croatia at Wembley seven years ago, then limped off with a hamstring injury, with Armand Traore coming on.
Rangers goalkeeper Rob Green dealt with a deflected effort from former Dundee United striker Johnny Russell and also got down well to tip past a post Ward's inswinging free-kick, which evaded everyone in the six-yard box. Redknapp was pinning his side's hopes on their 20-goal top scorer Charlie Austin, and the chance the former Burnley front man had been looking for arrived shortly before the hour.
Kevin Doyle sent Traore down the left flank and his cutback found Austin where he has been lurking most of the season, in front of goal, 10 yards out.
But Austin's finish let him down this time as he sidefooted the ball wide of Lee Grant's goal and was left holding his head in his hands with disbelief.
It looked like being a defining moment for Rangers, and worse was to follow three minutes later when Russell's attempt to burst through on goal was curtailed by a deliberate foul from O'Neil.
O'Neil argued that there were other defenders in the vicinity but referee Mason, probably correctly, decided veterans Dunne and Clint Hill were not going to catch Russell and produced a straight red card.
Derby sensed their chance and poured forward, forcing Green into point-blank saves from former Kilmarnock midfielder Craig Bryson, new Scotland squad member Chris Martin and Simon Dawkins in a frantic 10-minute spell.
But as the clock ticked down Derby captain Richard Keogh mis-controlled the ball in the area and Zamora, for the second time in his career, blasted in the most valuable goal in football.