The Spanish manager's current deal was set to expire at the end of the season, but he has committed to a further two years at the Etihad Stadium.
Guardiola joined City in 2016 and has overseen the most successful period in club history, winning four league titles and nine major trophies in total. But he has so far failed to win the Champions League with City.
The extension will take his time with the reigning Premier League champion to nine years, which far exceeds any of his previous coaching jobs.
Guardiola spent four seasons at Barcelona and three with Bayern Munich.
“I can't say thank you enough to everyone at the club for trusting me," he said Wednesday.
“From day one I felt something special being here. I cannot be in a better place.
“I still have the feeling there is more we can achieve together and that is why I want to stay and continue fighting for trophies.”
Guardiola has taken charge of 374 games at City, which is second only to Les McDowall (587) on the list of the club's post-war managers.
“He has already contributed so much to the success and fabric of this organization, and it's exciting to think what might be possible given the energy, hunger and ambition that he clearly still has," said chairman Khaldoon Al Mubarak.
“Under his very special leadership our first team has accomplished so much, whilst continuously playing, and constantly evolving, a City style of football that is admired the world over. Like every City fan, I am looking forward to what lies ahead.”