Sergio Aguero made a mess of a Panenka penalty as Chelsea ensured Manchester City must wait a little longer to wrap up the Premier League title by fighting back to earn a dramatic win at Etihad Stadium.
City, needing three points to become champions of England for the seventh time, took the lead just before half-time through Raheem Sterling's close-range strike.
Aguero had a glorious chance to make it 2-0 from the spot moments later when Billy Gilmour fouled Gabriel Jesus, but the Argentina striker opted for a dinked effort that was easily saved by Edouard Mendy.
The visitors had two more efforts ruled out for offside before Marcus Alonso won it for them in injury time, meeting Timo Werner's pull-back and sending the ball looping over Ederson.
This was Chelsea's second win over City in the space of three weeks, following their victory in the FA Cup semi-final at Wembley in April.
The two sides will meet again in the Champions League final in Istanbul at the end of this month.
Afterwards, Chelsea boss Thomas Tuchel said, "I think the second half was a fantastic response to the last five minutes of the first half where we almost lost it all. To me it was a clear 0-0 half but suddenly we did one decisive mistake and maybe the match becomes out of reach at half-time.
"With every minute we gained confidence and quality. We got better and better. It was a tough battle and once we got the equaliser we never stopped attacking. [The winning goal] was a huge reward.
"This tells us we can rely on our fitness which is a fantastic feeling at the end of a season. We can also rely on our team spirit, we keep going.
"This team never stops, they don't want to lose, they want it that bad."