Pep Guardiola, 41, who had been linked with Chelsea and Manchester City, has signed a three-year contract to 2016.
He will replace current boss Jupp Heynckes, who will retire.
The Spaniard has been on a season-long sabbatical since leaving the Nou Camp in May 2012 after winning 14 trophies – including two Champions League titles.
“We are very pleased that we have managed to convince the football expert Pep Guardiola, who was coveted and contacted by many top clubs, to come to Bayern Munich,” Bayern chief executive Karl-Heinz Rummenigge said.
“He 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.”
Bayern are currently nine points clear at the top of the Bundesliga, and face Arsenal next month in the last 16 of the Champions League.
Josef “Jupp” Heynckes, 67, informed the Bundesliga club before Christmas that he did not want to extend his contract beyond this summer.
His contract expires on 30 June, with Pep Guardiola taking charge the following day.
Bayern’s general manager Uli Hoeness said: “Only a coach of Guardiola’s calibre came into consideration as a successor to Jupp Heynckes.”
Some of Europe’s biggest clubs had been linked with the Spaniard since he left Barcelona, including English trio Manchester United, Manchester City and Chelsea, Italian giants AC Milan and big-spending Paris St Germain.
The appointment of former Barcelona duo Txiki Begiristain and Ferra Sorriano at the Etihad Stadium had fuelled speculation City could be a possible destination for Pep Guardiola.
Speaking in November, Milan president Silvio Berlusconi said: “Who would not want someone like Guardiola? There are some English clubs after Guardiola, especially [Manchester] City who have directors that we know very well. We will try to sign him, but it’s going to be difficult.”
Karl-Heinz Rummenigge, meanwhile, backed Jupp Heynckes, now in his third spell at Bayern after returning to the club in June 2011, to continue to excel in his final months as coach, having guided Bayern to a nine-point lead in the standings as the Bundesliga resumes following the winter break this weekend.
“As a club and as Jupp Heynckes’ friends we have to show understanding for this decision. We have to accept it and we have to respect it,” Karl-Heinz Rummenigge added.
“During personal talks with Jupp Heynckes we assured each other that we will do anything we can – and even more so now – to have a successful second half of the season and bring the title to Munich.”
Pep Guardiola had said earlier on Wednesday that he wanted to take on the “challenge” of managing an English club at some point in the future.
He said: “As a player I couldn’t realise my dream to play [in England].”
“But I hope in the future, I have a challenge to be a coach or a manager there.”
Pep Guardiola retired from playing in November 2006 and was named Barcelona B coach in 2007, but spent only a year in charge before being promoted to replace Frank Rijkaard as boss of the senior side.
Under Pep Guardiola, Barcelona established themselves as the dominant force in club football, with two Champions League crowns and three La Liga titles among the trophies claimed by a side containing names such as Lionel Messi, Xavi and Andres Iniesta.
Pep Guardiola factfile:
The US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…