Mario Gotze netted twice in ten-man Bayern Munich's 4-1 win at Hamburg which left the hosts poised for a play-off to avoid an historic German Bundesliga relegation.
As the only team in Germany's top tier to have never been relegated, Hamburg's 20th defeat of the season leaves them set for a two-legged play-off against the third-placed side in the second division, currently Greuther Furth, to stay up.
Bayern took the lead in the 32nd minute at Hamburg as Gotze squared to Arjen Robben and then tapped home the return pass to put the champions ahead. The Bavarian giants were recovering from their 4-0 defeat to Real Madrid in the UEFA Champions League semi-final second leg, but doubled their lead when Gotze was left free to roam and fired home Robben's corner on 55 minutes, which went in off Germany colleague Thomas Muller.
Gotze grabbed his second when he slotted home Muller's pass after Arjen Robben's shot was saved by Hamburg's Rene Adler. Hamburg pulled a goal back with 20 minutes left through Turkey midfielder Hakan Calhanoglu before Claudio Pizarro grabbed Bayern's fourth.
Bayern defender Jerome Boateng was sent off just before the final whistle for striking Kerem Demirbay. Gotze's double states his case to start against his former club Borussia Dortmund in the DfB-Pokal final on 17 May having voiced his disgruntlement after starting on the bench against Real.
The defeat means Hamburg can not now finish outside the bottom three, the same fate befalling Nurnberg after their 2-0 defeat at home to Hannover.
Bottom side Eintracht Braunschweig, who lost 1-0 at home to Augsburg thanks to Raul Bobadilla's 94th-minute goal, were already certain of finishing in the bottom three in their first season back in Germany's top flight. As the bottom three are separated by just two points, all that remains to be decided in next weekend's final round of matches is which two go down and who gets a play-off.
Three Dortmund goals in five minutes
Poland striker Robert Lewandowski enjoyed a 3-2 win against Hoffenheim in his final home match for second-placed Borussia Dortmund before joining Bayern next season.
Hoffenheim took the lead after just five minutes when Brazilian forward Roberto Firmino beat both Germany defender Mats Hummels and Marcel Schmelzer to drill home his shot. But Dortmund roared back with three goals in five minutes before the break.
Germany winger Kevin Grosskreutz slotted in a 29th minute shot, Henrikh Mkhitaryan headed home two minutes later and then Lukasz Piszczek hit their third after a mix up in the Hoffenheim defence from a free-kick. A bad mistake by Dortmund goalkeeper Roman Weidenfeller, who allowed a long-range shot from Niklas Suele to fly through his legs, made it 3-2 to the hosts with 66 minutes gone.
Ten-man Schalke need just one more point to secure a direct Champions League place next season after their 2-0 win at Freiburg kept them three points clear of Bayer Leverkusen in third as Dutchman Klaas-Jan Huntelaar scored his 59th league goal for the Royal Blues in his 100th Bundesliga game.
Leverkusen kept their grip on fourth, and a Champions League play-off place, with a 2-0 win at Eintracht Frankfurt. But both Borussia Monchengladbach and Wolfsburg can still claim the Bundesliga's fourth Champions League place next season.
'Gladbach's 3-1 win at home to Mainz keeps them sixth, three points from fourth, while Wolfsburg's 2-1 win at Stuttgart, thanks to Ivica Olic's late goal, also keeps them in the hunt for a Champions League spot, a point below Leverkusen.