Paul Furlong inspired QPR to a superb comeback after Leicester's David Connolly turned from hero to villain.
Connolly scored a magnificent goal at the end of the first half to add to James Scowcroft's opener - but was sent off seven minutes into the second half for an elbow on George Santos.
The red card sparked a Rangers revival and they hit back within two minutes through a Lee Cook header, before Furlong grabbed an equaliser midway through the second half.
And Furlong capped off the fight back with a last minute header to earn his side three points.
Rangers welcomed back Dan Shittu for his first league start of the season and dominated for large periods.
Jamie Cureton and Martin Rowlands went close with long-range drives early on but the game came to life after 22 minutes as Mark Bircham and Connolly got in a tangle. Rangers midfielder Bircham went to ground as the two scuffled waiting for a throw in and both were booked.
Rangers struggled to make the most of their possession and were made to pay just before the half-hour mark.
Dion Dublin's long ball over the top caused panic and keeper Chris Day rushed out of his goal to challenge Connolly in the air.
Day's header fell at the feet of Nathan Blake who eventually crossed for Scowcroft, who slid in and sent a right-foot effort flying into the net.
After 32 minutes Martin Keown and Furlong came to blows following a challenge on the edge of City's penalty area. A scuffle broke out between the pair and both were lucky to escape with cautions.
QPR's best chance of the half came two minutes before the break but Furlong failed to take advantage of a Nikos Dabizas mis-kick.
The moment of the match came in the second minute of first-half stoppage time, when Connolly scored for the first time in ten games with a stunning 25-yard curler into the top corner.
The Foxes striker's day soon turned sour however, as he was sent off seven minutes into the second period.
Connolly was adjudged to have elbowed Santos as the pair went for a header and received his second yellow card of the day.
The dismissal seemed to give Rangers renewed hope and five minutes later they were back in the game. Marcus Bignot crossed to the far post and Cook flew in to head home.
Rangers continued to push on in hope of an equaliser and on 69 minutes they got their reward. Rowlands produced a great curling cross and Furlong rose unmarked to head past Kevin Pressman.
And in the dying moments Cook crossed to the far post and Furlong jumped highest to head home the winner.