He said: "City have been one of the best teams in Europe over the last few seasons. They are brilliant to watch, play an exciting brand of football and compete for trophies so coming here feels like the perfect next step in my career."
Akanji will also come up against his old club when Guardiola's side face Dortmund in Group G of the Champions League.
The 27-year-old made 158 appearances for Dortmund after joining the Bundesliga side from Basel in 2018 and helped them to the DFB Pokal title last year.
Akanji has been capped 41 times by Switzerland and was part of the team who reached the quarterfinals at last year's European Championship.