Ilias Chair capitalised after a mistake by Wayne Rooney to score QPR's winner in a 2-1 victory over Derby.
Martyn Waghorn had hauled the Rams level after Grant Hall put Rangers ahead, but Chair's emphatic finish restored the home side's lead.
Chair, just on as a substitute, netted with 15 minutes remaining at the Kiyan Prince Foundation Stadium.
Rooney's attempted cross-field ball was intercepted by Ebere Eze, who cut in from the left and fed Chair with a clever pass.
The young midfielder did the rest, controlling the ball with an excellent first touch and then firing past 'keeper Ben Hamer.
Hall opened the scoring with a cracking strike 11 minutes before half-time.
Matt Clarke failed to deal with Geoff Cameron's ball into the box and it ricocheted off him towards Rangers captain Hall, who blasted in off the underside of the bar from 20 yards.
Derby had created the better chances and Waghorn should have put them ahead but volleyed over from close range after being found by Max Lowe's left-wing cross.
Clarke also volleyed over, in his case after being found unmarked by Rooney's corner, and Ryan Manning almost scored an own goal when he cut out Rooney's pass to Lowe and inadvertently diverted the ball just over the bar.
Rangers did threaten at times before going ahead - Jordan Hugill had an effort saved by Hamer following great work by Bright Osayi-Samuel, before Yoann Barbet went close with a free-kick.
Hamer was well beaten by Hall's thunderbolt but Waghorn atoned for his earlier miss by equalising with a header from Max Bird's left-wing corner a couple of minutes before half-time.
Hamer produced a fine save just after the hour mark when he kept out Marc Pugh's first-time shot following a deep cross from the right by Todd Kane.
The Derby stopper could not rescue his team after Rooney's costly error but did prevent a second Chair goal by keeping out his near-post header from Manning's cross, while R's keeper Liam Kelly did superbly to save Waghorn's late header.
QPR are now unbeaten in four matches and the win took them above Derby in the Sky Bet Championship table.
The defeat continued Derby's poor away form. They have won just twice on the road this season - only strugglers Luton and Barnsley have picked up fewer points away from home this season.
What the managers said...
QPR's Mark Warburton: "We've had games this season where we haven't got the rewards - and tonight I thought we rode our luck a bit in the final five or 10 minutes. We deserved that bit of luck - and we did ride our luck - and that's a vital three points for us.
"Derby are a very good team with a lot of quality and they are going to cause you problems. But we felt that our attacking prowess could hurt them as well and that proved to be the case."
Derby's Phillip Cocu: "For the second goal we didn't defend well - didn't make the right choice. The opponent didn't create a lot of chances but they were effective. We maybe created more, but they scored more. The way we played was not bad. But football is always about results, so we cannot be happy.
"It's frustrating. Away from home since the start of January we have been playing much better, dominating more and creating more, but the only issue is that we concede too many goals. We were able to create, so that's not the reason we didn't get the result."