Substitute Djibril Cisse boosted QPR's Premier League survival hopes with a late winner against a stubborn Stoke side at Loftus Road.
An unmarked Cisse converted Anton Ferdinand's near-post flick from Adel Taarabt's corner to keep Rangers above Bolton and out of the relegation zone.
Stoke's Thomas Sorensen had already brilliantly denied Taarabt and Cisse.
But it could have been different had Cameron Jerome not fired a glorious early chance into the side-netting.
Rangers had battled valiantly to break down Stoke's determined rearguard but failed to find a way through until Cisse's fifth goal in seven games since his January switch from Lazio.
Victory means QPR travel to title-chasing Manchester City, who will lift the Premier League crown with a final-day win, needing just a point to escape an instant return to the Championship.
A packed Loftus Road erupted after Cisse's 89th-minute intervention, which completely transformed the top-flight's race for survival in a crucial few minutes.
Mark Hughes's men looked like they were going to need a victory at the Etihad Stadium to stand any chance of preserving their status with third-bottom Bolton leading 2-0 against West Brom.
But the Baggies' late fightback for a draw, coupled with QPR's breakthrough, appears to put the west Londoners into the driving seat to stay up.
Hughes has long stressed that winning their battle to beat the drop would hinge on the number of points they managed to pick up at Loftus Road and he looked jubilant as Rangers clinched a remarkable fifth straight home win.
They started at a brisk tempo and enjoyed plenty of possession throughout with Taarabt, returning after a one-match suspension for his red card against Tottenham, spearheading the majority of their attacking play.
Their best first-half chance fell to the Moroccan, whose low 30-yard free-kick was pushed out by Sorensen only as far as Joey Barton who steered the rebound into the side netting from an acute angle.
Barton also headed straight at the Danish shot-stopper from point-blank range after leaping high to meet Bobby Zamora's cross moments later.
Sorensen produced a terrific one-handed save after the break to claw away Cisse's goalbound header as QPR continued to push forward in search of a much-needed winner.
Stoke have limped through the final throes of the season after securing safety weeks ago, despite boss Tony Pulis warning his players they still had plenty to play for.
The Welshman was desperate for Stoke to claim their first Premier League top-half finish since winning promotion in 2008 and reach the 50-point barrier.
They looked to be cruising towards both of those achievements before a recent run of just one win in ten matches.
But it could have been a totally different outcome for both teams had Jerome netted in the fourth minute.
Jerome, promoted to the Potters starting XI after his midweek equaliser against Everton, found space on the edge of the Hoops six-yard box to meet Peter Crouch's headed knockdown before lashing the ball past the wrong side of the post.
It was a huge let-off for Hughes and his men, who travel to Manchester next weekend knowing their future is back in their own hands.
Stoke manager Tony Pulis: "I'm massively frustrated because we didn't deserve to lose.
"The disappointing thing is we had opportunities and chances today but again we've not scored. That's been a problem all season if you look at our goals tally.
"We switched off from a set play and they've scored."