Pep Guardiola has signed a two-year deal that will see him remain as Manchester City manager until the summer of 2023.
The 49-year-old has won two Premier League titles, the FA Cup and three League Cups since joining in 2016.
Guardiola told City's website: "We have achieved a great deal together, scored goals, won games and trophies, and we are all very proud of that success.
"Having that kind of support is the best thing any manager can have."
The former Barcelona and Bayern Munich manager's previous deal was set to expire at the end of this season.
Guardiola's current five-year stay is already the longest commitment he has made to a team since becoming a manager in 2008.
If he sees out the contract, the Spaniard will overtake Joe Mercer and go second on the club's list of longest-serving post-war managers, behind Les McDowall, who took charge of 592 games between 1950 and 1963.
In total, City have won 181 of the 245 matches under Guardiola, a win rate of 73.87%.
Guardiola said: "We have had long talks this week together, we put [forward] both sides - to continue or not - and in the end we decided that the best for all of us is to continue because still we have the feeling that there is unfinished business and still there is something to do: continue what we have done in the last [few] years.
"I have the desire to help with all the fantastic players we have for the next years, especially for the fans - and we will feel proud of the way we play and the way we win.
"I would say that at this time, the reason I signed the contract is for our chairman. Especially for the conversations that we had. He convinced me that still we have to move forward, to try to do it, to continue what we have done in these incredible last four years together."
Chairman Khaldoon Al Mubarak added: "Pep's contract extension is the natural next step in a journey which has evolved over many years.
"It is a product of the mutual trust and respect that exists between him and the entire club. It also goes to the stability and creativity at the heart of our football operations.
"Importantly it is a validation of the football structure and philosophy that has been built over more than a decade and to which he has contributed so much."
- Watch Premier League football live on BBC iPlayer: Fulham v Everton - find out more here
BBC Sport's Simon Stone:
Guardiola has previously indicated he was open to remaining with the Blues, although he would only do so if it was what the club wanted.
The current upheaval at Barcelona led to suggestions Guardiola might return to the club he won the Champions League with as a player and a manager.
However, he has rejected that notion and it is thought he spoke to City officials during the international break and told them of his desire to stay.
City will be delighted at the news. Guardiola has won two Premier League titles - and in 2019 completed an unprecedented clean sweep of domestic trophies.
He remains determined to secure the club's first Champions League title though - having not got further than the quarter-finals in his time at the club.
City will back their manager in the transfer market as they have always done and now the big question is will today's news lead to the arrival of Lionel Messi?
Reuniting the brilliant Argentine with the manager he won so much under at Barcelona has always been a dream for the City hierarchy, which has a heavy Catalan presence in the former of chief executive Ferran Soriano and sporting director Txiki Begiristain.
Messi would have joined this year if he had not been blocked from leaving the Nou Camp.
But his contract expires in the summer. The prospect of him moving to Manchester is an enticing one indeed.
- Life After Reality TV: Love Island and basketball star Ovie Soko
- Racism in Football: See the scale of the problem in the game