Goals by Damion Stewart and Rowan Vine saw off Burnley and lifted QPR off the bottom of the Championship.
Alan Mahon hit the post for Burnley before Stewart met Scott Sinclair's left-wing corner with a downward header at the near post to open the scoring.
QPR keeper Lee Camp brilliantly denied James O'Connor as Burnley responded.
But Vine sealed victory in the last minute, firing into an empty net after Burnley keeper Gabor Kiraly had gone upfield searching for an equaliser.
Burnley boss Owen Coyle on an injury to Clarke Carlisle
"We had to rejig after Clarke went off and those kind of things went against us.
"We got caught at the set-play when their lad, who Clarke had been picking up, headed in.
"There will be no criticism of the players from me because we've had six games in 17 days."
QPR manager Luigi De Canio dedicates the win to striker Ray Jones, who died before the fixture was supposed to be played in August:
"This win goes out to Ray Jones. He was a great lad and we all remember him really fondly.
"This is from the players and the management and everyone at Loftus Road who remembers Ray."
Burnley: Kiraly, Alexander, Carlisle (Gudjonsson 48), Unsworth, Harley, Elliott, Mahon (James O'Connor 63), McCann, Lafferty, Blake (Jones 63), Gray.
Subs Not Used: Jensen, Akinbiyi.
QPR: Camp, Rehman, Stewart, Malcolm, Barker, Ainsworth (Moore 90), Bolder, Leigertwood (Walton 88), Sinclair (Blackstock 75), Nygaard, Vine.
Subs Not Used: Cole, Balanta.
Goals: Stewart 60, Vine 90.
Ref: Mike Pike (Cumbria).