MANCHESTER -- Manuel Pellegrini was informed last week that Pep Guardiola was set to take over as Manchester City manager next season, sources have told ESPN FC.
Pellegrini revealed at the end of Monday's news conference that he has agreed to part ways with the club on June 30 and City confirmed that Bayern Munich coach Guardiola will take charge for the start of the 2016-17 season.
The former Barcelona boss was heavily linked with City after revealing in December that he would leave Bayern and move to the Premier League, and sources said that City chairman Khaldoon al Mubarak told Pellegrini last week of the club's decision to appoint Guardiola.
Sources also said there is no acrimony over the decision, with Pellegrini now free to look for other jobs for next season.
The City manager told his players of the situation on Monday morning ahead of revealing the news to the media at a news conference.
Pellegrini confirmed to reporters that he wanted to make the news public to end the speculation over his future, which is why he chose to make the announcement three months before the end of the season. He hopes his squad can now focus on the rest of the campaign with his side still competing for four trophies.
Guardiola was a target for the club when Roberto Mancini was sacked in May 2012 and the club spoke to him before the Chilean took charge.
The Spaniard worked together with City director of football Txiki Begiristain and chief executive Ferran Soriano, at Barcelona where Guardiola won two Champions Leagues and three La Liga titles. But he still opted to go to Germany in 2013 after taking a year-long sabbatical.
City have now agreed a deal to take Guardiola to the Etihad, and the club believe Premier League rivals Chelsea and Manchester United had also been interested in him.
Sources said the Bayern boss was the only manager in the frame to replace Pellegrini, with Carlo Ancelotti and Jose Mourinho never considered.
Former Villarreal and Real Madrid boss Pellegrini, who turned 62 at the start of the season, has said previously that he would like to continue in management if he left City, preferably in the Premier League.
He has ruled out taking over as Chile boss, saying: "I hope to remain with competitive teams in Europe. I am not thinking about returning to Chile at least for the next three or four years."