Sunderland threw away a two-goal lead before Wes Brown's dramatic late strike gave them victory over QPR.
The Black Cats went ahead through Nicklas Bendtner's header and doubled it shortly after half-time through Stephane Sessegnon's breakaway goal.
Rangers responded through Heidar Helguson's close-range finish and Jamie Mackie's header within the space of four minutes.
But Brown's header snatched the win with two minutes remaining.
New Sunderland boss Martin O'Neill had called for greater ruthlessness from his team but would not have expected Brown to be the man to earn him a second win in three matches in charge.
The former Manchester United defender had not scored in the Premier League since October 2008 but his late effort secured only a fourth league win of the season for the Black Cats.
Results since Martin O'Neill took over
- 11 Dec: Sunderland 2-1 Blackburn
- 18 Dec: Tottenham 1-0 Sunderland
- 21 Dec: QPR 2-3 Sunderland
It is a victory that will have O'Neill looking up to mid-table after starting the day only three points above the relegation zone.
Rangers have managed only one win at Loftus Road all season, but boss Neil Warnock would surely have been satisfied with a point after a battling second-half performance.
They now head to Swansea and Arsenal over the festive period as they attempt to stay out of trouble.
QPR were determined to give themselves some breathing space ahead of the festive programme but, other than a series of Joey Barton set-pieces, they struggled to test the Sunderland defence in the opening period.
Bendtner had already gone close when a Sebastian Larsson free-kick was flicked on by John O'Shea and the Danish striker's glancing header came back off the inside of the post.
But he put the visitors ahead after 14 minutes when he evaded marker Matt Connolly to head in from Kieran Richardson's corner for his third of the season.
As Sunderland continued to look dangerous on the break, Richardson drove a swerving shot past the post from 25 yards.
Wes Brown's previous Premier League goals
April 24, 2005, Manchester United 2 Newcastle 1
October 4 2008, Blackburn 0 Manchester United 2
The hosts finally made a decent opening when Armand Traore's cross was met by Helguson's powerful header, which was cleared off the line by Titus Bramble shortly after half-time.
Just over a minute later, Sessegnon latched on to Danny Gabbidon's loose header to race clear before waiting for Paddy Kenny to commit himself and producing a calm finish.
But the home side pulled one back just after the hour, when Helguson nudged ahead of Brown to prod in Traore's cross.
Shortly afterwards, Alejandro Faurlin's clipped cross was headed down by Helguson for Mackie to score a second with a diving header.
After that, Sunderland created the majority of the chances, with Craig Gardner forcing a smart save from Kenny.
But with only just over a minute left, Brown's glancing header from Richardson's corner had enough power to beat the despairing attempted clearance of Faurlin.
QPR manager Neil Warnock: "I've never felt so disappointed. The lads were fantastic but all three goals were very poor. I don't want to go into them publicly.
"They got out of prison. You can accept losing to the better side and fantastic goals but we were the better side and the goals were poor.
"We've had so many blows, daggers in the heart, but I'll sort it out in January."
Sunderland manager Martin O'Neill: "There's still plenty of work to do and the players accept that. We're delighted with the win.
"We had a great response and at 2-0 we were in a great position but we won the game twice.
"It's pleasing. It hasn't cured all our woes but we're delighted."
- 01 Kenny
- 06 Gabbidon
- 13 Traore (Hall - 80' )
- 16 Connolly (Bothroyd - 90' )
- 18 Young Booked
- 04 Derry
- 11 Faurlin Booked
- 17 Barton
- 32 Wright-Phillips (Taarabt - 46' )
- 12 Mackie
- 22 Helguson
- 24 Cerny
- 03 Hill
- 05 Hall
- 07 Taarabt
- 09 Campbell
- 10 Bothroyd
- 21 Smith
- 20 Westwood
- 02 Bardsley
- 05 Brown
- 11 Richardson
- 16 O'Shea
- 19 Bramble
- 06 Cattermole Booked
- 07 Larsson (Gardner - 75' )
- 15 Vaughan (Colback - 71' )
- 28 Sessegnon Booked
- 52 Bendtner
- 24 Carson
- 12 Kilgallon
- 08 Gardner
- 14 Colback
- 23 McClean
- 27 Elmohamady
- 17 Ji Dong-Won
Live Text Commentary
Full Time The final whistle is blown by the referee.90:00 +6:27
Inswinging corner taken by Adel Taarabt from the left by-line, Unfair challenge on Titus Bramble by Heidar Helguson results in a free kick. Keiren Westwood restarts play with the free kick.90:00 +6:13
Jamie Mackie takes a shot. Craig Gardner gets a block in.90:00 +5:39
Stephane Sessegnon takes a shot. Patrick Kenny makes a save.90:00 +4:44
Adel Taarabt takes a shot. Kieran Richardson gets a block in.90:00 +3:14
Direct free kick taken by Keiren Westwood.90:00 +3:14 Booking
Booking The referee cautions Alejandro Faurlin for unsporting behaviour.90:00 +2:56
Alejandro Faurlin gives away a free kick for an unfair challenge on Lee Cattermole.90:00 +2:27
Adel Taarabt takes a shot. Save by Keiren Westwood.90:00 +1:33 Substitution
Substitution Jay Bothroyd comes on in place of Matthew Connolly.89:46
Nicklas Bendtner is caught offside. Patrick Kenny takes the free kick.88:37
Assist by Kieran Richardson.88:37 Goal scored
Goal! - Wes Brown - QPR 2 - 3 Sunderland Wes Brown finds the net with a headed goal from inside the six-yard box. QPR 2-3 Sunderland.88:18
Corner taken by Kieran Richardson from the right by-line to the near post,87:59
Phillip Bardsley takes a shot. Save by Patrick Kenny.86:31
Titus Bramble concedes a free kick for a foul on Heidar Helguson. The free kick is delivered left-footed by Alejandro Faurlin from left channel.86:14
The referee gives a free kick against John O'Shea for handball. Patrick Kenny takes the direct free kick.85:15
Foul by Alejandro Faurlin on Lee Cattermole, free kick awarded. Direct free kick taken by Titus Bramble.84:13
Joey Barton crosses the ball from the free kick right-footed from left channel.84:13 Booking
Booking Lee Cattermole receives a caution for unsporting behaviour.
Adel Taarabt fouled by Lee Cattermole, the ref awards a free kick.83:10
Free kick awarded for an unfair challenge on Craig Gardner by Matthew Connolly. Phillip Bardsley takes the free kick.82:23
Inswinging corner taken right-footed by Craig Gardner from the left by-line to the near post, Joey Barton makes a clearance.81:34
Kieran Richardson takes a inswinging corner. Nicklas Bendtner takes a shot. Fitz Hall gets a block in.80:25
Phillip Bardsley takes a shot. Fitz Hall gets a block in.79:10
Craig Gardner shoots direct from the free kick, blocked by Alejandro Faurlin.79:10 Substitution
Substitution Fitz Hall comes on in place of Armand Traore.79:10 Booking
Booking Caution for Luke Young.78:59
Free kick awarded for a foul by Luke Young on Nicklas Bendtner.77:18
Corner taken by Kieran Richardson from the right by-line played to the near post, save by Patrick Kenny.77:05
Craig Gardner takes a shot. Save made by Patrick Kenny.74:49
Foul by Lee Cattermole on Adel Taarabt, free kick awarded. Direct free kick taken by Luke Young.74:41
A cross is delivered by Luke Young.74:07 Substitution
Substitution Sebastian Larsson goes off and Craig Gardner comes on.72:16
Adel Taarabt takes a shot. Save by Keiren Westwood.71:33
Kieran Richardson challenges Adel Taarabt unfairly and gives away a free kick. Direct free kick taken by Luke Young.70:52
Sebastian Larsson takes a inswinging corner from the left by-line played to the near post.70:37 Substitution
Substitution Jack Colback joins the action as a substitute, replacing David Vaughan.69:44
Effort on goal by Adel Taarabt from outside the area goes harmlessly over the bar.68:18
Effort from 20 yards by Adel Taarabt. Save by Keiren Westwood.67:33
Patrick Kenny takes the free kick.67:33 Booking
Booking The referee cautions Stephane Sessegnon for unsporting behaviour.67:22
Stephane Sessegnon challenges Joey Barton unfairly and gives away a free kick.66:22
The assist for the goal came from Heidar Helguson.66:22 Goal scored
Goal! - Jamie Mackie - QPR 2 - 2 Sunderland Jamie Mackie grabs a headed goal from close in. QPR 2-2 Sunderland.64:24
Outswinging corner taken by Joey Barton, save made by Keiren Westwood.62:33
Alejandro Faurlin provided the assist for the goal.62:33 Goal scored
Goal! - Heidar Helguson - QPR 1 - 2 Sunderland Heidar Helguson grabs a headed goal from close in. QPR 1-2 Sunderland.62:30
Alejandro Faurlin delivers the ball,61:26
Joey Barton crosses the ball, save by Keiren Westwood.60:35
Outswinging corner taken by Joey Barton from the right by-line played to the near post, Lee Cattermole manages to make a clearance.52:47 Goal scored
Goal! - Stephane Sessegnon - QPR 0 - 2 Sunderland A goal is scored by Stephane Sessegnon from close range low into the middle of the goal. QPR 0-2 Sunderland.51:48
Corner taken by Joey Barton.51:35
Heidar Helguson takes a shot. Clearance made by Titus Bramble.49:46
The referee blows for offside. Free kick taken by Patrick Kenny.49:15
Matthew Connolly challenges Stephane Sessegnon unfairly and gives away a free kick. Free kick taken by David Vaughan.48:02
Shot from long range by Kieran Richardson goes wide of the left-hand upright.45:16
Effort from outside the penalty area by Stephane Sessegnon goes wide left of the target.45:01
The referee blows his whistle to start the second half.45:01 Substitution
Substitution Shaun Wright-Phillips leaves the field to be replaced by Adel Taarabt.45:00 +1:04 Half time
Half Time The match has reached half-time.45:00 +0:24
Alejandro Faurlin produces a left-footed shot from outside the penalty area and misses left.44:04
Nicklas Bendtner takes a shot. Matthew Connolly gets a block in.41:18
Armand Traore sends in a cross, Keiren Westwood makes a save.41:13
Joey Barton crosses the ball.39:25
Unfair challenge on Joey Barton by Lee Cattermole results in a free kick. Matthew Connolly takes the free kick.37:41
Corner taken left-footed by Kieran Richardson from the right by-line, Shaun Derry makes a clearance.36:49
A cross is delivered by Armand Traore, clearance by Phillip Bardsley. Outswinging corner taken by Joey Barton from the right by-line, Daniel Gabbidon takes a shot. Keiren Westwood makes a save. Stephane Sessegnon takes a shot. Matthew Connolly makes a save.35:02
Free kick awarded for a foul by Joey Barton on Lee Cattermole. Direct free kick taken by Phillip Bardsley.31:34
Kieran Richardson takes a inswinging corner to the near post, clearance by Shaun Derry.30:50
The ball is sent over by Kieran Richardson, clearance by Daniel Gabbidon. Corner taken by Kieran Richardson from the right by-line to the near post, Shaun Derry makes a clearance.30:07
Unfair challenge on Alejandro Faurlin by Phillip Bardsley results in a free kick. Joey Barton delivers the ball from the free kick right-footed from right wing.29:18
The ball is sent over by Sebastian Larsson, Luke Young gets a block in.28:45
Heidar Helguson challenges Wes Brown unfairly and gives away a free kick. Phillip Bardsley takes the free kick.27:44
Kieran Richardson takes the inswinging corner, Sebastian Larsson takes a shot. Blocked by Shaun Derry.25:26
Unfair challenge on Joey Barton by Lee Cattermole results in a free kick. Free kick crossed by Joey Barton.23:21
Sebastian Larsson gives away a free kick for an unfair challenge on Armand Traore. Joey Barton produces a shot on goal direct from the free kick, Lee Cattermole gets a block in.23:06
Shot from 18 yards by Jamie Mackie. Wes Brown gets a block in.22:26
Nicklas Bendtner is caught offside. Patrick Kenny restarts play with the free kick.19:54
Kieran Richardson produces a left-footed shot from just outside the area that goes wide left of the goal.18:53
Kieran Richardson provided the assist for the goal.18:53 Goal scored
Goal! - Nicklas Bendtner - QPR 0 - 1 Sunderland Nicklas Bendtner finds the back of the net with a headed goal from close in. QPR 0-1 Sunderland.18:21
Kieran Richardson takes the inswinging corner,17:22
Joey Barton takes a outswinging corner from the right by-line to the near post, John O'Shea makes a clearance.16:24
Shaun Wright-Phillips produces a right-footed shot from the edge of the area and misses to the left of the target.15:13
Nicklas Bendtner produces a volleyed right-footed shot from 25 yards. Blocked by Matthew Connolly.14:37
Sebastian Larsson takes a inswinging corner to the near post, Daniel Gabbidon makes a clearance.14:26
Headed effort from close in by Nicklas Bendtner bounces off the post.13:35
Alejandro Faurlin challenges David Vaughan unfairly and gives away a free kick. Free kick crossed by Sebastian Larsson.11:53
A cross is delivered by Sebastian Larsson, Patrick Kenny makes a save.9:51
Jamie Mackie is caught offside. Keiren Westwood restarts play with the free kick.8:33
Joey Barton takes a inswinging corner.7:59
Daniel Gabbidon fouled by Nicklas Bendtner, the ref awards a free kick. Direct free kick taken by Patrick Kenny.6:09
Free kick awarded for a foul by Phillip Bardsley on Shaun Wright-Phillips. The ball is sent over by Joey Barton, Close range header by Jamie Mackie goes over the crossbar.6:04
Jamie Mackie crosses the ball.4:33
Corner taken right-footed by Joey Barton from the right by-line, Headed effort from close range by Daniel Gabbidon goes wide left of the goal.4:23
Luke Young takes a shot. Wes Brown gets a block in.3:41
The assistant referee flags for offside against Nicklas Bendtner. Patrick Kenny restarts play with the free kick.1:39
Foul by Jamie Mackie on Titus Bramble, free kick awarded. Keiren Westwood takes the free kick.1:36
Joey Barton crosses the ball.0:00
The game gets underway.
Live data and text provided by our data suppliers