Christian Benteke eased Aston Villa's relegation fears and pushed bottom-placed QPR nearer to the drop as his late winner settled a pulsating Barclays Premier League clash.
Rangers dominated the opening half at Villa Park and deservedly led through a goal from midfielder Jermaine Jenas, only for Gabriel Agbonlahor to level against the run of play.
Andreas Weimann put the home side ahead early in the second half and, after Andros Townsend made it 2-2, Villa's Austrian striker set up the winner for Benteke.
It was Belgium international Benteke's seventh goal in the last eight league games and took his overall tally to 17 since his £8million summer move from Genk.
For much of the first half, QPR looked like a side brimming with confidence after their back-to-back wins against Southampton and Sunderland.
Only heroics from in-form Villa goalkeeper Brad Guzan and the woodwork prevented the visitors wrapping up the points before half-time.
Villa seldom posed a threat during the opening 45 minutes, with Christopher Samba winning his aerial battle with Benteke.
But the home side woke up and looked more dangerous after the break with Weimann deserving his goal for an energetic and committed display.
Benteke started to make his presence felt and his winner showed again why manager Paul Lambert believes he has already doubled in value as a Villa player.
Villa knocked the ball around in confident style in the very early stages.
QPR goalkeeper Julio Cesar picked up what might have been considered a back-pass from defender Jose Bosingwa, who came under pressure from Agbonlahor, but referee Kevin Friend waved play on.
The visitors stepped up a gear and Guzan made two excellent saves in the space of 60 seconds to keep his side on level terms.
The United States international backpedalled to turn a looping header from Samba over the bar after he had connected with a Bosingwa free-kick.
Then Guzan made an even better save to turn aside another effort from Samba, this time from just inside the box.
QPR midfielder Stephane M'Bia was the first player to be yellow-carded, bringing down Weimann.
Villa were forced into a change after 20 minutes when Nathan Baker appeared to be concussed in an aerial challenge with Samba and he was replaced by Joe Bennett.
The left-back made a shaky entrance into proceedings with his misdirected pass leading to Jermaine Jenas giving QPR the lead after 23 minutes.
Bennett played a square pass just inside his own half which was seized on by Jenas who released Zamora in space.
Zamora's low drive was parried by Guzan but Jenas continued his run into the box and was first to the loose ball to make no mistake from close range.
Villa midfielders Yacouba Sylla and Barry Bannan were booked in quick succession for fouls on Townsend and Weimann for arguing after QPR were awarded a free-kick.
The woodwork came to Villa's rescue when Bosingwa's powerful free-kick struck a post.
But in first-half injury-time Agbonlahor brought the home side level when he peeled off to the far post and headed home a right-wing cross from Matt Lowton.
Villa looked more dangerous after the interval and a Weimann header was tipped over by Cesar from Bennett's cross.
Then after 59 minutes Bennett atoned for his earlier costly error by setting up Weimann for his 11th goal of the season.
The former Middlesbrough player showed good control before supplying the pass to Weimann who cut inside before drilling a low left-footed shot past Cesar from 15 yards.
Lowton could have made it 3-1 but scuffed his shot across the face of goal.
Then with 17 minutes left the impressive Townsend made it 2-2. Loic Remy and Ji-Sung Park combined to tee up Townsend and his shot took a slight deflection as it flew past Guzan.
Villa responded and after 81 minutes Weimann turned goal-maker with his low cross turned in by Benteke after good play by substitute Charles N'Zogbia. This time QPR had no response and they now stand seven points adrift of safety with eight games to play.