Hamburg beat Wolfsburg 2-1 in dramatic fashion to secure their Bundesliga status and plunge the Wolves into a relegation play-off.
Wolfsburg, who lost to Real Madrid in the Champions League quarter-finals last year, must tackle a team from Germany's second tier to determine their fate.
They face a two-legged play-off against the third-placed side in Bundesliga 2 - who were Eintracht Braunschweig ahead of Sunday's final round of fixtures.
Needing victory to avoid the play-off after starting the final game in the bottom three, Hamburg snatched victory with Luca Waldschmidt's 88th-minute winner.
Robin Knoche had put Wolfsburg ahead but Filip Kostic levelled, and Waldschmidt delighted the Hamburg support when he headed in.
The most significant action was at the bottom of the table after Bayern Munich wrapped up the title in April. The champions finished their campaign with victory over Freiburg.
Arjen Robben, Arturo Vidal, Franck Ribery and Joshua Kimmich scored in a 4-1 win which means Carlo Ancelotti's side finished 15 points clear of Leipzig. Nil Petersen netted a consolation.
It also marked the final game for captain Philipp Lahm and Xabi Alonso before retirement.
Leipzig lost a 2-0 lead in the final seven minutes of their final game, as Jesus Vallejo and Danny Blum scored to earn Eintracht Frankfurt a 2-2 draw.
Marcel Sabitzer and Yussuf Poulsen had put Leipzig in charge as they completed a fairytale debut campaign in the top flight.
Pierre-Emerick Aubameyang's late penalty handed Borussia Dortmund a 4-3 win over Werder Bremen to clinch third and a Champions League spot.
Aubameyang's two goals also meant he finished as the Bundesliga's top scorer with 31 goals, one ahead of Bayern's Robert Lewandowski.
Marco Reus also scored twice for the hosts while Bremen's Zlatko Junuzovic, Fin Bartels and Max Kruse netted for the visitors.
Dortmund's season ends next weekend when they meet Eintracht Frankfurt in the German cup final.
Hoffenheim drew 0-0 with Augsburg to finish fourth, while Cologne beat Mainz 2-0 thanks to goals from Jonas Hector and Yuya Osako to qualify for the Europa League.
It meant Augsburg avoided the relegation play-off and finished 13th while Mainz also escaped on goal difference to finish 15th.
Hertha Berlin's hopes of finishing fifth were dashed after a 6-2 defeat to Bayer Leverkusen.
Elsewhere, Ingolstadt bowed out of the Bundesliga with a 1-1 draw at home to Schalke while already-relegated Darmstadt drew 2-2 with Borussia Monchengladbach.