The Bavarian outfit have finished in the bottom two for a record eighth time, while Torsten Lieberknecht's men's stay in the top flight ends after one year
Hamburg travelled to Mainz for matchday 34 knowing that they needed to match or better both sides' results.
Mirko Slomka's side lost 3-2 but were spared an automatic drop as Schalke and Hoffenheim claimed 4-1 and 3-1 wins over Nurnberg and Braunschweig respectively.
For Nurnberg, this is their eighth relegation, claiming outright the record they used to share with Arminia Bielefeld.
Braunschweig, meanwhile, have looked set for the drop all season, having spent the majority of the campaign rooted to the foot of the table.
Hamburg are likely to play Greuther Furth in the relegation playoff after finishing two points clear of Nurnberg and three ahead of Braunschweig.