Marc Nygaard raced clear to put QPR ahead after only six minutes, but Ade Akinbiyi headed a quick equaliser.
Marc Bircham headed a corner into his own net after 29 minutes, before Paul Jones saved Paul Iffil's penalty after Ian Evatt fouled Chris Morgan.
Morgan deflected Nygaard's header into his own goal after 56 minutes and Paul Furlong's left-foot finish sealed a shock victory with 16 minutes left.
QPR boss Gary Waddock:
"Sometimes you need a little bit of luck and we got that.
"If you come up to Sheffield United you're not going to dominate the game.
But we defended well and then had a few chances in the second half.
"The group of players that are downstairs and were training this week have worked their socks off."
Sheff Utd: Kenny, Morgan, Kozluk, Collins, Armstrong, Ifill, Jagielka, Tonge, Montgomery (Unsworth 63), Akinbiyi (Shipperley 78), Horsfield (Webber 66).
Subs Not Used: Flitcroft, Kabba.
Goals: Akinbiyi 21, Bircham 29 og.
QPR: Jones, Bignot, Evatt, Shittu, Rose, Bircham, Cook, Lomas (Santos 90), Langley, Furlong, Nygaard (Youssouf 72).
Subs Not Used: Bailey, Baidoo, Thomas.
Booked: Nygaard, Langley, Shittu, Lomas.
Goals: Nygaard 6, Morgan 56 og, Furlong 74.
Ref: K Friend (Leicestershire).