Derby County scored twice in second-half stoppage time to seal a crucial win over QPR and return to the top six.
Results elsewhere meant that Derby rose back into the play-off places with three games to play, but for so long they were frustrated by the visitors as they lacked the quality in the final third to do any serious damage.
That all changed after nine minutes of stoppage time were announced - Rangers not helped by their own time-wasting throughout the second-half - and that gave the Rams enough time to finally turn the screw.
Harry Wilson was the hero both times with a penalty and then a calm finish with virtually the last kick, and Derby's patience was rewarded.
The Rams nearly led early on when Martyn Waghorn flicked on a Wilson free-kick with his right foot but Rangers keeper Joe Lumley was able to claw the ball away.
Rangers had begun with a degree of vigour too and Nakhi Wells saw an effort blocked out for a corner by Fikayo Tomori after being fed by Josh Scowen, Darnell Furlong heading Scowen's flag kick high over the bar.
Tom Lawrence skewed a shot wide at the other end 12 minutes in as Derby tried to get a foothold in the game, Wells' weak shot straight at Kelle Roos the next threat nine minutes later.
The game needed some inspiration and Luke Freeman nearly provided it with a low drive from 25 yards which was just wide of Roos's left-hand post.
But other than a low Wilson drive which was easily gathered by Lumley, the half would end with little else to get either set of fans too excited.
The second-half saw Derby begin well, Wilson's 35 yard free-kick pushed away by Lumley six minutes in.
Rangers felt they should have had a penalty moments later when Freeman went to ground after turning his man but referee David Webb wasn't interested.
Waghorn headed a Jayden Bogle cross wide on 57 minutes, then Mason Mount got into the area but slipped as he got a shot in under pressure from a defender and the ball went well wide.
Rangers nearly nabbed the lead when Scott Malone's error let in Bright Osayi-Samuel down the right and his pull back was inches away from Tomer Hemed in the six yard box.
At the other end, Wilson's free-kick from out wide was tipped over the top by Lumley, then the Rams came even closer when Wilson sent Mount clear on goal but his scuffed shot got a touch off Lumley and came back off the inside of the post.
Rangers were offering little but big striker Matt Smith came on as sub and then headed a Pawel Wszolek cross too high with eight minutes to go, then Roos had to push away a looping Ebere Eze cross-shot which could have gone anywhere.
Smith headed a Freeman cross wide as nine minutes of injury-time were announced, that rousing the crowd as they sensed an extra opportunity to take all three points.
And sure enough, their moment came four minutes into that period. Bogle burst into the box where he was fouled by Freeman, Wilson stepping up to slide the ball low to Lumley's right and into the net.
Jack Marriott was inches from a second when his shot from outside the penalty area flew just wide, fellow sub David Nugent doing similar with a shot from a little closer moments later as the Rams finished strongly.
A late scare saw Rangers win a free-kick out wide that caused an element of havoc in the Rams penalty area, but after the hosts had cleared, they then broke away as Marriott found himself through on goal, opting in the end to square for Wilson alongside him and he finished low to seal the win and send Pride Park into delirium.
Derby: Roos, Bryson (Bennett 38), Tomori, Keogh (c), Wilson, Mount, Waghorn (Marriott 69), Lawrence (Nugent 78), Johnson, Bogle, Malone
Subs not used: Carson, Evans, Cole, Huddlestone
QPR: Lumley, Furlong, Cameron, Freeman, Scowen, Manning, Hemed (Smith 73), Osayi-Samuel (Eze 82), Luongo (c), Wszolek, Wells (Walker 90+6)
Subs not used: Ingram, Shodipo, Phillips, Walker, Tilt
Ref: David Webb
Derby - Wilson 90+4pen, 90+11
Star Ram: Harry Wilson