Djibril Cisse scored two minutes from time to drag QPR from the canvas and record a hugely important 1-0 win over Stoke that could well secure the club's Barclays Premier League status.
Thanks to West Brom's late comeback to draw 2-2 at Bolton, QPR are now two points above the relegation zone ahead of next weekend's season finale at Manchester City, where a draw will be enough to ensure survival.
Stoke looked the stronger side early on and Cameron Jerome volleyed wastefully over fromPeter Crouch's knock-down to from 10 yards.
Crouch got on the end of Rory Delap's long throw but Rangers' defence scrambled clear, before the home crowd urged their team on after news of Martin Petrov's opener for Bolton filtered through to Loftus Road.
Stoke almost grabbed the lead on two occasions just after the break. Crouch miscued a free header and Ricardo Fuller curled a wicked shot that flew just wide.
Hughes threw on Jay Bothroyd and Shaun Wright-Phillips at the death to add some extra impetus and the move worked. Wright-Phillips' shot deflected wide, leading to a QPR corner. Adel Taarabt's cross was nodded on by Anton Ferdinand and up popped Cisse to stab home from close range to send the home crowd into ecstasy.