Newcastle ensured Premier League survival with a game to spare as already-relegated QPR went down with a whimper at Loftus Road.
Sitting just a place above the drop zone heading into the penultimate game of the season, Alan Pardew's side were in real danger of a second relegation in four years.
However, Hatem Ben Arfa's penalty and a Yoan Gouffran strike helped the Magpies come from behind to secure a victory that ensured another season in the top flight.
It had not always looked so plain sailing, though, with Loic Remy's early spot-kick putting Harry Redknapp's side ahead and ending a 376-minute wait for a goal.
Rather tellingly, though, the fans were announced as QPR's players' player of the year earlier in the day.
Jose Bosingwa was one of those to have come under particular scrutiny having refused to sit on the bench earlier in the campaign and further harmed his popularity this afternoon.
First Ben Arfa netted from the spot after being tugged back by the Portuguese, who then played a major part in the visitors' second.
The right-back's weak back-pass was met by an equally poor attempt at a clearance by Robert Green, with Gouffran duly slotting home.
Bosingwa did not return for what was a tense second half and, despite goalkeeper Rob Elliott's late sending off, Newcastle held out for a vital three points.
There was an uneasy atmosphere around Loftus Road heading into the game and that translated onto the pitch.
QPR edged a poor opening that only came into life in the 11th minute when Mathieu Debuchy, one of two Newcastle changes, gave away a penalty as referee Lee Probert adjudged him to have fouled another returning player, Junior Hoilett.
Yohan Cabaye was booked for his remonstrations but they counted for nothing, with former Newcastle target Remy slotting home.
"You're going down with the Rangers" chanted the home fans but their joy was short-lived.
Bosingwa marked his return to the starting line-up with a fantastic block to deny Cabaye from close range, only to quickly become the villain once again.
Ben Arfa burst into the box and the Portuguese undid his good work by foolishly tugging the Newcastle man's shirt in clear view of Probert.
Another spot-kick was awarded and the France international stepped up to smash home, with the ball going in off the underside of the bar.
It took just seven minutes for the Magpies to draw level and it appeared they had turned the match on its head by the 22nd minute.
Debuchy swung in an exquisite right-wing cross that was nodded home at the far post by Papiss Cisse, only for the goal to be chalked off after the Senegalese striker drifted offside.
Hoilett forced Elliott into a fine reaction save when QPR returned to the attack but, like so many times this season, poor-decision making cost them dearly.
Bosingwa's popularity plummeted to a new low after sending a weak back-pass to Green and, under pressure from Jonas Gutierrez, the Rs goalkeeper could only clear as far as the unmarked Gouffran, who cushioned a volley into the empty goal.
"Harry, take him off" bellowed the QPR support in disgust at Bosingwa's display, who got their wish as Redknapp replaced him with Fabio for the second half.
Shaun Derry also came on for the second half in place of Stephane Mbia, who was also booed by QPR fans after a message on his Twitter account appeared to suggest he wanted to return to Marseille.
The changes did not kick the visitors into life, though, with few moments of note until the 62nd minute, when Hoilett wriggled free of several United players before shooting across the face of goal.
Ben Arfa drilled into the wall after Green picked up a back-pass from Armand Traore in the box when played returned to the other end, with Derry then clearing a Gutierrez effort off the line after a penalty-box melee.
Gouffran shot wide soon after but Newcastle were living dangerously with a one-goal lead - something that looked even more tentative eight minutes from time when they were reduced to 10 men.
Newcastle goalkeeper Elliott handled the ball outside the box and was shown his second yellow of the afternoon, with Steve Harper replacing Ben Arfa for the closing stages.
Andros Townsend came close to breaking the hearts of the 1,608 away fans in stoppage time but United held out to take maximum points and secure top-flight status.