Substitute Sinclair Armstrong struck the vital goal with his first touch as QPR held off a Leicester City fightback to earn a shock win that consigned the stumbling leaders to a third consecutive Championship defeat.
Armstrong ran on to Sam Field's lay-off to make it 2-0 after Ilias Chair had tapped in a simple opener with Rangers' only effort on target before the break.
Ben Nelson scored his first Foxes goal to give Leicester hope with 30 minutes remaining.
The home side piled forward in the closing stages, finishing with 19 attempts on goal, but Rangers defended resolutely to move three places above the relegation zone.