Pep Guardiola will take charge of Bayern Munich on a three-year contract starting next season, the Bundesliga club have confirmed.
Current Bayern coach Jupp Heynckes will stay on in his post until the end of this season before the former Barcelona boss takes over on a deal that runs until June 2016.
Bayern chief executive Karl-Heinz Rummenigge said: "Pep Guardiola is one of the most successful coaches in the world and we are sure that he can make not just Bayern, but all of German football shine."
Guardiola will take over at the German giants on July 1 with Heynckes' contract running out on June 30.
The 41-year-old Guardiola announced last April he would be leaving Barca when his contract ran out at the end of the season and would be taking a year-long sabbatical from the game.
A host of clubs had been linked with the Spaniard since he left Barca, including Manchester United, Manchester City and Chelsea in England, Italian giants AC Milan and big-spending Paris St Germain. However, Bayern recently emerged as favourites to capture Guardiola's services.
Guardiola replaced Frank Rijkaard at Barca in 2008 and during his four years at the Nou Camp he led the Catalan giants to 13 trophies, making him the most successful coach in the club's history.