Pellegrini succeeds the sacked Roberto Mancini, and he will begin his three-year deal with the club on June 24, according to the club's announcement.
"I am delighted to accept this hugely exciting opportunity," Pellegrini said. "The club has a clear vision for success both on and off the pitch and I am committed to making a significant contribution."
Pellegrini guided Malaga to the quarterfinals of the UEFA Champions League this past season and previously led Villarreal to the Champions League semifinals.
"Everything is in place for Manchester City to continue to be successful and I am excited to be able to work with such a talented squad, the executive team and the board to deliver for fans who are renowned for their steadfast support," he said.
Pellegrini had to wait to complete the move while contractual issues with Malaga were sorted. The deal is reportedly worth 15 million pounds ($23.5 million).
"Manuel is a hugely experienced and successful manager with a proven track record," City chairman Khaldoon Al Mubarak said.