Mainz guaranteed their place in next season's Bundesliga with a shock 2-1 win over Borussia Dortmund at Signal Iduna Park on Saturday.
Goals from Ridle Baku and Yoshinori Muto secured the visitors' first away win against Dortmund in the top flight, despite Maximilian Philipp halving the deficit.
The result moves Mainz six points clear of Wolfsburg, who occupy the relegation play-off place, while Dortmund must avoid defeat to Hoffenheim on the final day to make certain of a Champions League spot.
Mainz stunned RB Leipzig with a 3-0 win last time out and Baku's fine finish silenced the home fans only four minutes in, after they had honoured the retiring Roman Weidenfeller with a rousing tifo.
Muto made the most of slack defending to double the lead but Philipp's precise finish dragged a poor Dortmund back into the contest.
Peter Stoger's side dominated much of the final hour but created little by way of clear-cut chances for an equaliser, meaning they face a decisive visit to Rhein-Neckar-Arena next week, while Mainz can celebrate their survival.
Baku scored a late third in the win over Leipzig last week but he only needed four minutes to strike again on Saturday, rifling high into the net from 12 yards out after a brilliant backheel from Jean-Philippe Gbamin.
Dortmund's defence was exposed again nine minutes later, when Muto was given a free run at Pablo De Blasis' cross and glanced a header beyond Roman Burki.
The home side were stunned but only needed three minutes to respond. Jadon Sancho dribbled into space in the penalty area and slid the ball to Philipp, who turned well with his back to goal and drilled into the bottom-right corner.
Mainz began to drop deeper but continued to look dangerous on the break, and Burki had to make quick-fire saves to deny Alexander Hack and Abdou Diallo before the break.
Dortmund's pressure increased in the second half, with Marco Reus looking particularly dangerous, and Mainz were lucky referee Daniel Siebert did not see Diallo push his head into Julian Weigl's midriff and reduce them to 10 men.
Stoger, who had not been beaten at home as Dortmund boss before the game, introduced Andre Schurrle and Andriy Yarmolenko and the latter was inches from reaching a teasing cut-back from Reus.
Marcel Schmelzer had a header saved by Florian Muller but that was as close as Dortmund came to a second goal, and they must get at least a draw against fourth-placed Hoffenheim on the last day of the season to make sure they do not lose their top-four spot to Bayer Leverkusen, who are three points behind in fifth.
Key Opta Facts:
- For the first time under Peter Stoger (after 6 wins and 3 draws) Borussia Dortmund have lost a home game in the Bundesliga.
- Mainz have avoided relegation and will play their 10th consecutive Bundesliga campaign next season.
- For the first time Dortmund have lost a home game against Mainz in the Bundesliga (7 wins, 4 draws).
- At the age of 20 years and 27 days Mainz’s Ridle Baku is the youngest player to score in his first two Bundesliga games since Dortmund’s Ralf Augustin in 1978 with 18 years and 10 days.
- With his 9th goal of the season Maximilian Philipp has equalled his personal Bundesliga record (9 goals for Freiburg 2016-17).