The German giants announced on Wednesday they had won the race for the coveted 41-year-old, who had been linked with a host of Europe's top clubs including Manchester United, Manchester City and Chelsea.
Guardiola on Tuesday revealed his desire to one day coach in England, but the Spaniard's next destination will be the Bundesliga after penning a deal which ties him to the Allianz Arena until June 2016.
He will replace current Bayern boss Jupp Heynckes in the summer, with the 67-year-old deciding to retire when his contract expires on June 30.
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."
AC Milan and Paris St Germain had also been reportedly interested in Guardiola, who is on a year-long sabbatical from the game since bringing the curtain down on his record-breaking four-year stint with Barcelona last summer.
Chelsea have been repeatedly linked with the man Blues owner Roman Abramovich is reputed to admire greatly, but Guardiola will no longer be an option when interim manager Rafael Benitez's stint in charge finishes at the end of the season.
Bayern will be hoping Guardiola can repeat the incredible success he enjoyed at the Nou Camp, both as a player and as a coach.
After coming up through the youth ranks, the classy midfielder went on to captain the senior Barcelona side and during 11 seasons in the first team of his home city club he made 472 appearances.
He also helped Barcelona win a host of trophies, including their first European Cup title, six league crowns, the European Cup Winners' Cup, and two Copa del Reys.
After leaving Barcelona in 2001, Guardiola played for Italian sides Brescia and Roma and also had stints in Qatar and Mexico before hanging up his boots in November 2006.
He was named as the coach of Barcelona B in 2007, but spent only a year at the helm before being promoted to replace Frank Rijkaard, who left in the summer of 2008 after going two years without a trophy win.
Under Guardiola, Barca established themselves as the dominant force in club football, with many rating the team as the best in history.
Boasting the likes of Lionel Messi, Xavi and Andres Iniesta, Barcelona won 14 trophies, comprising two Champions League crowns, three Primera Division trophies, two Copa del Reys, three Supercopas, two UEFA Super Cups and two FIFA Club World Cups, during Guardiola's tenure.
That made Guardiola the most successful coach in the club's history before he opted to step down when his contract ran out last summer in order to take a break from the game.
The retiring Heynckes also boast an impressive CV and is on course to leave Bayern as Bundesliga champions, with the team currently nine points clear at the summit. They are also in the last 16 of the Champions League and the quarter-finals of the DFB Pokal.
Heynckes is in his third spell at Bayern and returned to the club in June 2011.
Although he failed to prevent Borussia Dortmund winning their second successive Bundesliga title last season, he did guide Bayern to the Champions League final in May, when his charges were defeated by Chelsea on penalties in front of their home fans in Munich.
Heynckes first led Bayern from 1987 to 1991, claiming Bundesliga titles in 1989 and 1990, and returned on an interim basis in April 2009 to guide them into the Champions League qualification spots following the sacking of Jurgen Klinsmann.
Heynckes told Bayern prior to Christmas that he was not looking to extend his contract with the club beyond this summer.
Bayern Munich chairman Uli Hoeness said: "We are extremely grateful to Jupp Heynckes for all his work, Following his decision, we would be delighted if the team was to give this coaching great the glorious farewell he deserves.
"As a worthy successor to Jupp Heynckes, only a coach of Pep Guardiola's calibre comes into question."
Guardiola's agent Josep Maria Orobitg said the deal to go to Bayern had been signed before Christmas.
He also said the offer from Bayern was not the most lucrative they had received, but was the one that appealed most to Guardiola.
"He signed before Christmas. I don't know exactly which day, around the 20th or the second half of December," Orobitg told EFE Radio.
"He chose Bayern because of all the teams from which he had offers it was the best.
"We were looking over the offers and this isn't the team which offered the most money. It was chosen for the organisation there, for the potential that he sees, and for their players."
Regarding interest from elsewhere and the constant speculation surrounding Guardiola's next step, Orobitg added: "There were contacts with clubs which were close, others which were put on hold until a decision was taken.
"There have been things coming out from all sides that there had been offers, real meetings, false meetings, trips which didn't exist.
"From Christmas he had to choose his future. All this has been signed for some time. I didn't know that they were going to announce it this afternoon. In fact they informed me at 12 that it was coming out in a statement."