Nahki Wells' last-gasp goal against his former club gave Bristol City a dramatic 2-1 victory at QPR.
Wells' winner was totally against the run of play, as was Chris Martin's opening goal a minute before the interval.
Sam McCallum's second-half equaliser - his second goal in as many games - appeared to have earned a point for Rangers, who were pushing for a second goal when they were hit with a classic sucker punch.
City broke forward and Andreas Weimann set up Wells, who had two loan spells at QPR before his move to the west country. The striker, who had not scored in his previous seven appearances, calmly steered the ball beyond keeper Seny Dieng.
Rangers had created a number of chances, with Lyndon Dykes heading Willock's left-wing cross against the post and Moses Odubajo heading wide at the far post after being found by Yoann Barbet.
City's Daniel Bentley was by far the busier keeper in what was a one-sided first half before Martin's goal.
Bentley denied Andre Gray after the on-loan Watford striker had turned away from Tomas Kalas, and he also pushed over a shot from Stefan Johansen.
This was QPR's 100th league match under Mark Warburton and although they have made significant progress during his time as manager, falling behind after failing to take chances has been a regular theme of his tenure.
It was the case in midweek at Bournemouth, where they suffered their first defeat of the season, and again on this occasion.
The Robins counter-attacked after Moses Odubajo had given the ball away. Han-Noah Massengo evaded Jordy de Wijs on the left and sent in a low cross towards Andreas Weimann, who held off Rob Dickie and laid the ball back for Martin to tuck away his third goal of the season.
The hosts finally found the net nine minutes into the second half at the Kiyan Prince Foundation Stadium when Chris Willock's dangerous left-wing cross was headed away by Rob Atkinson but only as far as McCallum, who thumped home from 18 yards out with his less-favoured right foot.
They then put City under major pressure as they searched in vain for a second goal. Bentley gathered a long-range effort from Barbet, twice denied Dykes at point-blank range and similarly prevented substitute Charlie Austin putting QPR ahead after the striker was put through on goal.
Bentley was also grateful to see strikes from Willock and Barbet flash narrowly wide as Rangers continued to dominate.
And in injury time Bentley was called into action twice more, diving to his right to keep out Willock's shot and saving at his near post from Johansen.
They proved to be crucial stops as Wells had the final say.
What the managers said...
QPR's Mark Warburton: "The message to the players is to not lose sight of the fact that we're going in the right direction. We're a very good team. We've got to go under the radar, keep playing our football and just be a bit more ruthless. You can see we're a good team.
"We're creating chances and scoring goals - our goal difference tells you that. We're creating chances against good teams both home and away."
Bristol City's Nigel Pearson: "I've got to be honest, we came up against a very good side today. I'm not kidding myself. QPR are a very good side. Mark went very positive with his selection against us today. It's good to get three points and we're moving in the right direction. What was most pleasing was the collective effort and the desire to get a positive result.
"We know it was a huge effort to come away with three points. Certain players will get the headlines but you need a strong collective effort to come out the other side with a positive result. But we weren't lucky. They were two great finishes and the second one was a tremendous counter-attacking goal. When you get chances you have to take them and we did today - we were pretty ruthless. Today was a great example of Championship football at its best, with two sides trying to win it."