The 32-year-old’s exit was confirmed by both clubs on Monday morning.
Gundogan signs for the LaLiga giants after seven years at the Etihad.
In his last year with City, the German midfielder won the Treble under Guardiola and has now spoken of his appreciation for the coach.
“Been a total privilege and pleasure to be part of Man City for the last seven years. I would like to thank Pep.
“To have been able to play under and learn from him for so long has been something I will never forget.
“I would also like to thank all my team-mates – past and present – who have all played such a special part in making my time here so amazing. Also incredible City fans. I owe them all so much for their support. I will carry City always in my heart. Once a blue, always a blue,” Gundogan said.