Manchester City manager Pep Guardiola
The former Barcelona and Bayern Munich manager, 51, has won nine major trophies, including four Premier League titles, since taking charge at City in 2016.
"I am so pleased to be staying at Manchester City for another two years," said Guardiola in a club statement issued Wednesday.
"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."
The Spaniard added: "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."
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."
- 'Not eternal' -
Guardiola's current deal at the Etihad Stadium is due to expire at the end of the season.
He has already extended his contract twice during his time at the club.
Guardiola, who has 271 wins from 374 matches in all competitions as City manager, said talks over his latest contract extension started soon after the team had retained the Premier League title in May.
As for feeling he could "not be in a better place", he added: "The moment I don't feel that - for family reasons, or I have achieved everything I want to achieve, or I don't feel comfortable with the team, or it's not a pleasure to fight for another Premier League - when these feelings disappear, I will step aside.
"That is normal in life. I am not eternal. Every day we are here, we are closer to the end. That is normal.
"But still I have this feeling there is something more to do. That is my feeling right now. And that is why we continue together."
City are currently second in the Premier League table, five points behind leaders Arsenal, and will face RB Leipzig in the Champions League last 16 when elite club football resumes after the break for the ongoing World Cup in Qatar.
As well as the league triumphs, Guardiola's trophy haul at City also includes one FA Cup and four League Cups.
But Guardiola, who guided Barcelona to two Champions League titles, has still to win European club football's greatest prize at City, although they were runners-up when losing 1-0 to English rivals Chelsea in the 2021 final.
That match in Portugal is still the only time City have reached the final of either the Champions League or its forerunner, the European Cup, with their lone piece of major continental silverware coming when they won the now defunct European Cup Winners' Cup back in the 1969/70 season.
Guardiola added: "I have the feeling we can do better. This is the reason I want to do more - the job is not done. We want more and I want more. We feel that.
"Still, we are in the process. If I feel it is done, the relations would remain forever, and another chapter for both sides will be taken. Simple as that."
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)