Manchester City reignited the Premier League title race as they ended Liverpool's 20-game unbeaten start to the season to reduce their lead at the top of the table to four points.
Pep Guardiola's hosts knew nothing less than a win at Etihad Stadium would do on a Thursday night riddled with tension that produced a game that was frenetic if not a classic.
Leroy Sane produced the decisive moment 18 minutes from time as he collected Raheem Sterling's pass to fire across Liverpool goalkeeper Alisson, after it had seemed like Roberto Firmino's stooping header would maintain the visitors' unbeaten sequence.
Sergio Aguero had earlier given City the lead with a rising, near-post drive just before the interval.
That came after a moment of drama when Reds forward Sadio Mane hit the City post and John Stones scrambled the ball off the line after his attempted clearance struck goalkeeper Ederson - with data subsequently showing the ball had failed to cross by just 1.12cm.
Both sides had chances in a frantic finale but it was City who claimed a crucial win.
Man City deliver required response
Guardiola was blunt before the biggest Premier League game of the season: anything other than victory was not an option.
And while City did not produce the purist style that is their trademark, they dug deep to get the job done despite some late moments of panic in their penalty box and wayward finishing in the other.
City were in danger of falling off the pace following three recent losses that allowed Liverpool to open up an imposing advantage - and that was why the stakes were so high amid a crackling atmosphere.