The Spaniard's previous deal had been due to expire at the end of the season.
Advertisement
With the new contract now signed, that should see Guardiola through to nine years at the Etihad Stadium.
Guardiola joined the club from Bayern Munich in 2016 and has led the City to unprecedented success.
He has won nine major trophies, including four Premier League titles, since taking charge.
Advertisement
Guardiola said in a statement from the club: "I am so pleased to be staying at Manchester City for another two years.
"I can't say thank you enough to everyone at the club for trusting me. I am happy and comfortable, and I have everything I need to do my job as best as possible.
"I know the next chapter of this club will be amazing for the next decade. It happened over the last 10 years, and it will happen in the next 10 years because this club is so stable.
"From day one I felt something special being here. I cannot be in a better place.
Advertisement
"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."
Advertisement
City chairman Khaldoon Al Mubarak said: "I am delighted that Pep's journey with Manchester City Football Club will continue.
"He has already contributed so much to the success and fabric of this organisation, and it's exciting to think what might be possible given the energy, hunger and ambition that he clearly still has.
Advertisement
"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."
Guardiola has been nothing short of a revelation for City, who have dominated English football since his arrival six years ago.
As well as four Premier League titles, they have lifted four League Cups under his leadership, as well as one FA Cup in 2019.
City also reached the Champions League final for the first time in their history, although they ultimately lost to fellow English giants Chelsea.
Advertisement
Despite an overall impressive start to the season, the Citizens sit second in the Premier League table behind Arsenal, and lost their final game against Brentford before the break for the World Cup.