Union Berlin secured Champions League qualification for the first time in their history as Schalke suffered relegation from Bundesliga on the final day of the season.

Rani Khedira's 81st-minute winner at home to Werder Bremen saw Union pip Freiburg to fourth place in the German top flight, with Urs Fischer's side booking their spot in UEFA's top club competition for next season.

There was no such good fortune for Schalke, though, as they dropped back down to 2. Bundesliga following a 4-2 defeat to third-placed RB Leipzig on Saturday.

As Bayern Munich celebrated edging out Borussia Dortmund for the title on goal difference, Stuttgart will be left to fight for their top-flight status in a play-off after a 1-1 draw at home to Hoffenheim.

Stuttgart will face either Hamburg or Heidenheim, with whoever finishes third in the German second division due to battle with Sebastian Hoeness' men for a place in Bundesliga next term.

Had Stuttgart won, Augsburg would have been in that play-off after a 2-0 final-day defeat at Borussia Monchengladbach, while Bochum pulled clear of danger with a 3-0 victory over Bayer Leverkusen.