Bayer Leverkusen battled back to claim the final UEFA Champions League spot with a 2-1 victory over Werder Bremen on the final day of the German Bundesliga season as Nurnberg and Eintracht Braunschweig were relegated.
Leverkusen looked set to be pipped to fourth place by Wolfsburg as they trailed 1-0 to Theodor Gebre Selassie's 21st-minute goal, but Omer Toprak levelled just after the half-hour mark and Son Heungmin got the winner eight minutes into the second half.
The Wolves had to settle for fifth place, a point behind, despite a 3-1 win over Borussia Monchengladbach, who join them in the UEFA Europe League. Kevin De Bruyne put the Wolves ahead after 30 minutes, but Christoph Kramer levelled after 64 minutes. Ivan Perisic restored the hosts' lead four minutes later and Robin Knoche sealed the points nine minutes from time.
Schalke needed just a draw to wrap up third place, but won handsomely, their 4-1 home success over Nurnberg condemning the visitors to the drop. Leon Goretzka put the Royal Blues ahead after only six minutes and Roman Neustadter doubled the lead on the stroke of half-time. Julian Draxler added a third in the 75th minute and, even though Josip Drmic pulled one back in the 90th minute, there was still time for Chinedu Obasi Ogbuke to get a fourth for Schalke.
Braunschweig will join Nurnberg in the second tier after losing 3-1 to Hoffenheim. Goals from Sebastian Rudy (14), Roberto Firmino (64) and Kevin Volland (70) had Hoffenheim three up, with Jan Hochscheidt grabbing a late consolation.
Victories for either Nurnberg or Braunschweig would have kept them up as Hamburg's losing run continued, but in the end Hamburg lived to fight another day, despite their 3-2 defeat at Mainz. Hamburg remained third bottom, in the relegation play-off spot.
Mainz, who finished in the final Europa League berth, went ahead through Elkin Soto after seven minutes, but Pierre-Michel Lasogga equalised five minutes later. Yunus Malli (65) and Shinji Okazaki (82) put Mainz two goals in front before Ivo Ilicevic (84) got a second for Hamburg.
Bayern celebrate with closing win
Champions Bayern Munich completed the season with a 1-0 win at home to Stuttgart, but they had to rely on a goal two minutes into injury-time from Claudio Pizarro.
Robert Lewandowski marked his last Bundesliga match for Borussia Dortmund ahead of his summer move to Bayern with two goals in a 4-0 win at Hertha Berlin. The Pole got the first and third goals for second-placed Dortmund, with Milos Jojic and Henrikh Mkhitaryan also on target.
Hannover won 3-2 at home to Freiburg, Edgar Prib with the 80th-minute winner. Szabolcs Huszti put Hannover ahead in the 45th minute, but Jonathan Schmid equalised. Artjoms Rudnevs restored the hosts' lead five minutes after coming on, only for Philipp Zulechner to level, but Prib had the final say.
Augsburg came from behind to win 2-1 against Eintracht Frankfurt, goals from Ragnar Klavan and Andre Hahn securing the victory after Joselu's early opener.