The captain broke down a dangerous and stubborn Leicester with a howitzer of a shot on 73 minutes to put the Blues within touching distance of defending the crown won in a canter last season.
It was one of those ‘I was there’ moments on a night of almost unbearable tension at the Etihad.
City started brightly but it was the visitors who caused the first real threat with a succession of half-chances during one attack in the ninth minute – an early warning for the hosts.
A minute later and Phil Foden collected a lofted pass inside the Leicester box before spinning a half-volley straight at Kasper Schmeichel.
The visitors had set up to find pockets of space between the City midfield and defence and whenever they came forward and were looking dangerous in possession – what the Blues needed was a goal to ease the tension.
And that goal almost came on 32 minutes when Ilkay Gundogan’s whipped corner found the head of Sergio Aguero and the ball struck the underside of the bar before Schmeichel pawed the danger clear – this time, the goal-line technology indicated it was no goal.
Moments later David Silva’s volley flashed wide as the Blues finally started to cause one or two problems.
City’s best moments in the opening period were when Bernardo was on the ball, with the Portuguese, as ever, constantly busy and inventive.
The first-half ended goalless with the Blues desperately needing a flash of inspiration or slice of luck after the break.
The first real chance of the second period came when Kyle Walker’s deep cross was nodded back into the six-yard box by Silva and Raheem Sterling jumped a fraction to early with his header going well over.
There was more urgency and intent about the Blues who made an early switch with Leroy Sane replacing Phil Foden before the hour-mark.
City were building a head of steam and when Sterling was felled in the box on 60 minutes, the Etihad screamed for a penalty, but referee Mike Dean waved appeals away.
The Foxes then went close as Harry Maguire ran fully 60 yards before finding James Maddison whose powerful shot went a foot or so wide.
On 69 minutes a mistake by Maguire saw the ball run through to Aguero who sent a snap shot towards goal but Schmeichel saved well with his knees.
Then, moments later, cometh the hour, cometh the captain.
With team-mates marked either side of him as he strode forward he looked up and fired a ferocious shot into the top right-hand corner from fully 25 yards to send the City fans wild.
It was going to take something unexpected to break down a Foxes defence who were playing as though their lives depended on it, but there was still work to do.
As the minutes ticked by, so did the almost unbearable tension that went with a slender lead.
The Foxes were still counter-attacking with pace and in numbers and one pass to Kompany saw the captain slip and almost allow Vardy a free run on goal – but he just managed to recover in time.
With three minutes left, Hamza Choudhury won a challenge on the halfway line, broke forward and fed former Blue Kelechi Iheanacho in the box but the Nigerian swept a low shot wide.
Leicester pumped long ball after long ball forward in the dying seconds, but the Blues defended superbly to cling on to a priceless three points.
What it means?
City record a 13th straight win and climb back to the top of the Premier League table with one game remaining.
Star man: Vincent Kompany
Just superb from the captain.
"We celebrate on the pitch today, it was nice to win last game at home. The last two or three months the support's been incredible.
"Leicester are so dangerous. They wanted to play but I not expect to defend so deep.
"Of course we are so happy because no win would be almost impossible to win title. Players are mature and we have one more game.
Will be tough in Brighton. They take result at arsenal. We play few weeks ago against them (in the FA Cup semi-final) and it was tough. They play for pride but it's in our hands. We were 7 points behind but we never give up.
"We are still there and we win 13 games in a row."
City go to Brighton needing one more victory to seal the Premier League title.
News about Man City v Leicester
Classic highlights: City 1-0 Leicester
Cometh the hour, cometh the captain! Watch more