The France centre-back was in Manchester in July to complete a medical after the two clubs agreed a £31.8 million deal.
City had tried to sign Mangala during the January transfer window but the Portuguese club held firm, despite the investment trust which owns part of his economic rights willing to do a deal.
The Premier League champions also unsuccessfully attempted to sign Mangala's team-mate, Brazilian midfielder Fernando, in the winter window, but announced his signing during the World Cup.
“City is a top club in Europe," Mangala told the club's official website. "For me, it was an important step to leave Porto and join Manchester City in order to continue my progress. I want to win titles and I believe I can do this. I am ambitious and this is why I am here.
“I’m very happy to come to England because for me, the Premier League is the best league in the world. It is a very intense and very aggressive competition. There are plenty of goals, so it is also really nice to watch and I can’t wait to get started!
“The fact that Fernando is here is better because I played with him at Porto but there is also other players that I know like Sagna, Clichy and Nasri."
City had prioritised the capture of an elite central defender to partner Vincent Kompany, and the 23-year-old Frenchman becomes the club's sixth summer signing after Bacary Sagna, Fernando, Willy Caballero, Frank Lampard and Bruno Zuculini.