The club's most successful manager is leaving, bringing to a close a trophy-laden, 10-year spell in which he established City as a force in Europe and changed the face of English soccer.
Guardiola had a year left on his City contract but will take charge of his final game on Sunday against Aston Villa in the Premier League.
"Don't ask me the reasons I'm leaving. There is no reason, but deep inside I know it's my time," he said on Friday.
City said Guardiola will become a global ambassador and the club was naming its newly developed stand at Etihad Stadium after him.
Enzo Maresca — the former Chelsea manager who was previously assistant to Guardiola at City — is the favourite to take on the daunting task of filling the Catalan's shoes after a decade of unprecedented dominance.
Since joining City in the summer of 2016, Guardiola has led the Abu Dhabi-owned team to six Premier League titles and a first Champions League crown in 2023.
He won 17 major trophies including a domestic double this season of the English League Cup and the FA Cup. He has won 35 major titles across his coaching career, including at Barcelona and Bayern Munich.
City was by far his longest job in management, having never previously stayed more than four years in a role.
"I will not train for a while," the 55-year-old Guardiola said. "I feel I would not have the energy that is required to daily … with the expectations to fight for the titles."
Guardiola's biggest achievement was leading City to the ultimate treble in 2023, winning the Premier League, Champions League and FA Cup — matching Manchester United's feat from more than 20 years earlier in 1999.
He also brought to England a style of soccer — a possession-based approach that started with playing the ball out from the goalkeeper or defence — that ended up being mimicked across the country, from kids' teams at grassroots level to rivals in the Premier League.
While he goes out on another trophy-winning campaign, this was the first time in his career that he has gone two seasons without being crowned league champions.
England boss Thomas Tuchel led the tributes to Guardiola, saying: "The impact he had on every league where he trained, it's just one of a kind, just one of the very, very, very best.
"He made a big revolution with the way he played at Barcelona and then he put everything upside down in the German league, and then he comes here and crushes every record.
"It's just outstanding. There are no words that can describe this determination and this level of input, it's just highest, highest level."
With AP