Kevin Gallen grabbed an 89th minute penalty to give QPR a 1-0 win over Stockport County following a dour battle at Loftus Road.
It looked as if the game was fizzling out into a 0-0 draw until the last minute when Gallen raced into the box and was felled by County defender John Hardiker.
The striker picked himself up and thumped home his 10th goal of the season to secure the points.
Stockport dominated the first half and both Luke Beckett and Ben Burgess fired shots over the bar when well placed.
But Rangers hit back after the break and created two clear-cut chances to win the match.
First the lively Gallen was put through by Marc Bircham only to see his powerful shot superbly saved by Lee Jones.
Then on 79 minutes Gallen fed Bircham and his cross picked out substitute Richard Pacquette who headed against the post.
County strikers Burgess and Beckett had further chances to score in the second half but it was Gallen's late penalty which gave QPR the final say.