Djibril Cissé has twice been the villain since joining Queens Park Rangers from Lazio in January, the hot-tempered Frenchman having been sent off on two occasions in no time at all as his new club plummeted towards the depths of the Premier League.

On Sunday, he was the reformed hero, rescuing QPR from a dreaded fate – probable relegation to the Championship – with an 89th-minute winner against Stoke City. With Rangers labouring towards a goalless draw at Loftus Road and Bolton Wanderers leading West Bromwich Albion 2-1 at the Reebook, the west London club were languishing in the Premier League pit. And with no prospect of getting out either, bearing in mind their trip to face the champions-elect Manchester City on the final day of the season next Sunday. It is QPR, after all, who have the worst away record in the top flight.

Then, suddenly, all change. Cissé, an early second-half substitute, poked in from close range, after Anton Ferdinand had nodded on Adel Taarabt's corner, to send the doom-mongers among the home fans – most of the 17,319 crowd – into a frenzy. When news of West Bromwich's late equaliser from James Morrison filtered through, there was bedlam. QPR were out of the pit and one point at the Etihad – albeit a target that, if achieved, would border on the miraculous – will see them safe. Even a defeat, as City are crowned champions, might not matter as the frantic jostling of the clubs below them unravels. From the apparently down-and-out position of Sunday, QPR are just relieved to be able to fight another day.

"Bringing on Djibril was part of my cunning plan," Mark Hughes, the QPR and former Manchester City manager, said. "It's been a bit stop-start for him but when he has been on the pitch, he's always been involved in our key moments.

"He's just the guy you wanted on the end of that chance. It's food and drink for him and thankfully he converted it. It was great for us, we left it late and it wasn't a great game – the momentum we have been able to create in recent weeks was hard to replicate.

"A draw for us would not have been enough and I'm just grateful that when we go to City, at least our fate is in our own hands. Maybe it's also a little bit fated that I'm going there on the final day. If we were to get something, it would be a fantastic story. We know it will be difficult but we still have that opportunity to do it ourselves."

QPR were nervous throughout in a mish‑mash of a display. They might have won their previous four home games – against the distinguished likes of Liverpool, Arsenal, Swansea City and Tottenham Hotspur – but they had few ideas of how to break down Stoke's stubborn defence.

Taarabt did what he does best, hog the ball, but his selfishness knew no bounds as time and again, in attempting shots on goal, he ignored better-placed team-mates.

At the time of their 3-2 victory at Stoke in November, QPR sat ninth in the league. But their slide has taken root on the back of an appalling disciplinary record – eight red cards, six of them at Loftus Road – and has barely been arrested since the arrival of Hughes to replace Neil Warnock in January. In total, QPR have played with 10 men this season for almost five‑and‑a‑half hours. It is a damning statistic.

If on their best behaviour this time, there was little else to commend them. Stoke carved out numerous chances only to fall short with their finishing.

"We didn't deserve to lose," Tony Pulis, the Stoke manager, said. "When we got in good positions, we just couldn't hit the target."

Joey Barton, the QPR captain, manfully tried to inspire his players as everything appeared to be crumbling around him yet, ultimately, he succeeded. "The atmosphere was electric, it gives us such momentum," he said. "A lot of people wrote us off 10 or 15 games ago. But we've kept compact, kept chipping away and we are still the masters of our own destiny. It's a massive game for not only City but us as well."

Cissé had already seen a goal-bound header magnificently clawed away by Thomas Sorensen, the Stoke goalkeeper, as his side mounted attack after attack. The clock was ticking down, the natives were not just restless but apoplectic, the Championship beckoned. But Cissé, so often the rebel, showed the more acceptable side of his nature. The bad boy, at last, done good.