City said the Bayern Munich coach has agreed a three-year contract to succeed the Chilean, who has been at the helm since 2013.
The club said the former Barcelona boss, 45, was in discussions to join City in 2012 before talks stalled.
"Out of respect for Manuel Pellegrini and the players, the club wishes to make its decision public to remove the unnecessary burden of speculation," City said in a statement.
"Manuel, who is fully supportive of the decision to make this communication, is entirely focused on achieving his targets for the season ahead and retains the respect and commitment of all involved with the leadership of the club."
Pellegrini, 62, who broke the announcement at the end of a news conference on Monday, guided Manchester City to the Premier League title in his first season in charge in 2014.
He signed a one-year contract extension last August to stay at the club until June 2017.
Guardiola announced in December that he would not be extending his contract with German champion Bayern, where he will be replaced by Carlo Ancelotti at the end of this season.
Following a year's sabbatical, Guardiola joined Bayern in 2013 and led the club to the German Bundesliga title in his first two seasons in charge.
The former Spain international was previously at the helm of Barcelona, where he won 14 trophies including three La Liga titles and two European Champions Leagues between 2008 and 2012.
City goalkeeper Joe Hart backed Pellegrini in an interview with CNN last month but said it would be a "pleasure"
to play under Guardiola.
"Pep has done some great things in the game and there's some great managers in the game of football," the England international said.
"I'm sure he'd be a pleasure to play under but right now I'm more than happy to play under Manuel."
Man City is second in the Premier League behind Leicester City and has reached the last 16 of the Champions League.
City will play Chelsea in the fifth round of the FA Cup before traveling to Dynamo Kiev on February 24. It will then face Liverpool in the League Cup final four days later before hosting the Ukrainian team in the second leg on March 15.