QPR 3-2 Liverpool
Jamie Mackie got the winner as QPR came from two goals down with 13 minutes left to beat Liverpool and move out of the relegation zone.
Sebastian Coates scored a spectacular volley and Dirk Kuyt prodded in a second to put the Reds ahead.
Shaun Derry gave QPR hope with a header before Reds old boy Djibril Cisse also nodded in to haul the home side level.
A Jose Enrique error left Mackie clear to slide in an injury-time shot under keeper Pepe Reina for the QPR winner.
The victory was as vital for the home side as it was unlikely and helped move them two points clear of the drop zone, although third-from-bottom Bolton have a game in hand.
The loss left Liverpool's already faint hopes of a top-four finish in tatters, with the Reds a massive 12 points behind fourth-placed Tottenham after a fourth league defeat in five games.
The latest setback for the Reds was much of their own making in a turnaround which was as spectacular as the opener from centre-back Coates.
QPR seemed to be feeling the pressure of their precarious position early on, particularly after relegation rivals Blackburn had won on Tuesday.
The home side constantly gave the ball away and Liverpool had plenty of chances to take advantage as they swarmed all over their hosts.
Suarez left Nedum Onuoha trailing to burst clear on goal only to have his shot fended away by keeper Paddy Kenny before Derry blocked a Stewart Downing strike when the Reds winger seemed set to have a free shot on goal.
Kuyt had a great chance when he latched on to a Steven Gerrard corner to the far post but he was denied by another save from the overworked Kenny.
Liverpool's profligacy has been a hallmark of their season and, while it appeared to drain their belief, QPR took plenty of encouragement from weathering the early storm.
The home side eventually managed to get a view of the visitors' goal and Reds keeper Reina was a relieved figure when former Liverpool striker Cisse's 22-yard shot went just wide.
QPR began to look comfortable but it proved a false sense of security. A Stewart Downing shot was cleared off the line by Bobby Zamora and, as the ball fell in the QPR box, Coates produced an acrobatic scissors kick to finally reward Liverpool's domination.
A Luis Suarez shot hit the post and Kenny saved from Downing before Kuyt stole in to pounce on the rebound and extend Liverpool's lead on his 200th Premier League outing.
There was little sign of the drama to come until Derry pulled one back with a 77th minute header from a corner to galvanise the home side.
Cisse nodded in another after 86 minutes and, when Reds left-back Enrique missed a clearance in added time, Mackie took full advantage to complete QPR's remarkable comeback.