Wataru Endo has scored scored in stoppage time to clinch Bundesliga survival for VfB Stuttgart.
Meanwhile, the league’s two top strikers, Robert Lewandowski and Erling Haaland, appeared to have scored their final goals for their clubs in Saturday’s final round of matches.
Endo struck in added time to give Stuttgart a dramatic 2-1 victory against Cologne and instead send Hertha Berlin into a play-off tie.
Felix Magath’s Hertha lost 2-1 to Borussia Dortmund, with Haaland on target for the hosts in his final game there before a summer move to Manchester City, as they slipped behind Stuttgart into third last on goal difference.
Champions Bayern Munich blew a two-goal lead from Josip Stanisic and Lewandowski in a 2-2 draw at Wolfsburg, amid the likelihood that this was also the Pole’s last strike for them in the league.
Bayern board member sport Hasan Salihamidzic had earlier confirmed the World Footballer of the Year Lewandowski would not renew his contract beyond 2023.
Salihamidzic has ruled out a summer transfer but there is reported interest from Barcelona and elsewhere for the prolific scorer.
Arminia Bielefeld were relegated for the eighth time along with Greuther Furth after a 1-1 draw with RB Leipzig, who secured the last Champions League slot in fourth with the point.
Union Berlin won 3-2 against Bochum to finish fifth and go into the next Europa League, along with Freiburg, 2-1 losers at Bayer Leverkusen, in sixth.
Cologne in seventh will play in the next Europa Conference League.
In their game in Stuttgart, Sasa Kalajdzic headed the hosts 1-0 ahead against Cologne in the 11th, just seconds after seeing his penalty sensationally saved by goalkeeper Marvin Schwabe.
Anthony Modeste headed the equaliser for Cologne in the 59th minute after a blunder from keeper Florian Muller, but Endo’s diving header two minutes into stoppage time spared them from the play-off.
Things had looked grim for Stuttgart because Hertha had led in Dortmund from Ishak Belfodil’s first-half penalty but Haaland got his 86th and last Dortmund goal in 88 games from the spot.
Then Dortmund sub Youssoufa Moukoko netted their winner with his first touch with five minutes left.
Champions Bayern, meanwhile, completed a disappointing run of three games without victory, and face plenty of unrest over Lewandowski’s future.
They led 2-0 from headers by Josip Stanisic and Lewandowski, who finished as the league’s top scorer again with 35 goals for a Bundesliga tally of 312 goals in 12 years for Dortmund and Munich. Only the late, great Gerd Muller scored more.
But Jonas Wind and Max Kruse scored for Wolfsburg.
Elsewhere, Borussia Monchengladbach routed Hoffenheim 5-1 but Gladbach coach Adi Hutter then resigned afterwards.
Mainz and Europa League finalists Eintracht Frankfurt drew 2-2, while Augsburg beat Furth 2-1.