Dortmund entered Saturday's decisive final match two points clear of Bayern, but Edin Terzic's side were stunned in a 2-2 draw following a disastrous first half that saw Mainz go two goals ahead and forward Sebastian Haller miss a penalty.
Meanwhile, Bayern travelled to Cologne and went ahead inside 10 minutes thanks to an early goal from winger Kingsley Coman.
A late penalty from Cologne midfielder Dejan Ljubicic looked to cause more late drama -- with the title heading to Dortmund as it stood. However, Bayern forward Jamal Musiala netted on 89 minutes to seal a memorable 2-1 victory.
Dortmund scored a stoppage-time equaliser through Niklas Sule but had just seconds to chase a winner, with the final whistle confirming Bayern's 33rd German top-flight title.
It has been a turbulent campaign for the German club as they switched managers during the season, but the March arrival of Thomas Tuchel managed to steer Bayern to yet another league triumph as they continued their decade-long dominance.
For the second half of the campaign, it looked increasingly like the club's reign of dominance was going to end.
Bayern parted ways with manager Julian Nagelsmann back on March 24 and replaced him with Tuchel. At that stage of the season Bayern were locked in a title challenge with Dortmund and RB Leipzig, and in the Champions League. But they crashed out of the European competition at the quarterfinal stage to Manchester City, leaving Tuchel with sole focus on the league with the team exiting the DFB-Pokal at the quarterfinal stage to Freiburg.
Bayern have also endured a series of off-field mishaps this season, including longtime goalkeeper Manuel Neuer breaking his leg while skiing in December after World Cup, as well as the fallout from the departure of goalkeeping coach Toni Tapalovic in January. In April, star signing Sadio Mane was stood down for a game after an altercation with teammate Leroy Sane after their first-leg defeat to City on April 11.
On the pitch, Bayern sometimes struggled, too. In the penultimate game of the season, Tuchel's side were dealt a major blow to their title hopes in a stunning 3-1 home defeat to RB Leipzig, meaning Dortmund would enter the final day with a two-point advantage.
However, with Dortmund struggling under the pressure Saturday, Bayern were able to seal the championship in the final few minutes of the season and sustain their dominance of German football.