Bayern Munich were crowned Bundesliga champions for the 11th straight season after a dramatic final day where Borussia Dortmund drew 2-2 at home to Mainz — when a win would have sealed a first title since 2012.
Bayern left it late on Saturday to get the win they needed at Cologne, substitute Jamal Musiala netting in style on 89 minutes in one of the most thrilling finishes to a season seen anywhere.
Fourth-placed Union Berlin snatched a maiden Champions League spot from Freiburg after they won 1-0 at home to Werder Bremen and Freiburg lost 2-1 at Eintracht Frankfurt.
Schalke were relegated following a 4-2 loss at third-placed RB Leipzig while VfB Stuttgart are in the relegation play-off spot after a 1-1 draw at home to Hoffenheim as Bochum won.
Augsburg stayed up despite a 2-0 loss at Borussia Mönchengladbach.
Freiburg must make do with the Europa League again, with 10-man Bayer Leverkusen taking a European spot despite losing 3-0 at Bochum.
Wolfsburg lost 2-1 at home to relegated Hertha Berlin, meaning Frankfurt jumped above them into seventh. If Frankfurt beat Leipzig in next weekend's German Cup final they will go into the Europa League and bump Leverkusen down to the Conference League play-off. If they lose, Leverkusen take the Europa League place and Frankfurt the Conference League qualifier.
The Bundesliga title race has seen a mass of twists and turns this season after years of Bayern waltzing to the championship and there were two last big stings in the tail.
Dortmund had been handed a golden chance to break Bayern's run when their rivals lost 3-1 at home to Leipzig last weekend, but the weight of history proved too much.
Bayern coach Thomas Tuchel, who has presided over exits from the Champions League and German Cup since arriving in March, surprisingly dropped Musiala, Leon Goretzka and Joao Cancelo in Cologne.
A super finish from Kingsley Coman on eight minutes put Bayern ahead.
Dortmund had Jude Bellingham on the bench after knee trouble and made a nervous start with 81,000 expectant fans in the stadium and thousands more packing bars across the city hours before kick-off.
Mid-table Mainz had nothing to play for but then took the lead in Dortmund, Andreas Hanche-Olsen's diving header after a badly-defended corner suddenly had the hosts in a real hole, a point behind Bayern in the live table.
Dortmund striker Sebastien Haller, who missed the first half of the season because of cancer treatment, soon had a penalty saved to deepen the home fans' fears.
The spotkick had been awarded after a video review and another penalty shout soon afterwards for Dortmund was waved away.
The unmarked Karim Onisiwo's header made it 2-0 to Mainz before half-time to further stun Dortmund, who had won their last 11 home league games in a row.
More drama followed in Cologne where Leroy Sané thought he had put Bayern 2-0 up just before the break but a handball by the forward was spotted by the video assistant and it was chalked off.
Mainz striker Onisiwo struck the woodwork in the second half and a desperate Dortmund eventually scored through Raphael Guerreiro.
A Cologne leveller against Bayern would have given Dortmund the title irrespective of their result. A Serge Gnabry handball and Dejan Ljubicic's 81th minute spotkick suddenly made it 1-1 in Cologne and Dortmund fans were in dreamland.
But the mercurial Musiala climbed off the bench and scored with aplomb to break hearts in Dortmund, with Niklas Süle's injury-time leveller in vain as Bayern won the title on goal difference.
Hertha were relegated last weekend and fellow traditional club Schalke followed them into the second division after just one season back in the Bundesliga.
Leipzig were already assured of third and the Champions League next term, but even with a German Cup final against Frankfurt next weekend, the holders did not take their foot off the gas.
Konrad Laimer, set to join Bayern in July, netted in the first half and Christopher Nkunku, due to sign for Chelsea, added a second soon afterwards before Marcin Kamiński cut the deficit for Schalke.
Schalke equalized early in the second period after a bizarre own goal from Willi Orban, but Yussuf Poulsen and Nkunku ended their hopes.
Bochum's success meant 2007 champions Stuttgart must beat the third team in the second division after home and away legs in the coming weeks to stay up. SV Hamburg are currently in third spot in the second tier ahead of their season finale on Sunday.
- Bayern Munich
- Bundesliga champions