(CNN) -- Bayern Munich secured qualification for next season's Champions League on Saturday with a thumping 8-1 away win at St Pauli.
The emphatic result ensures Bayern will finish in at least third place while consigning their hosts to relegation out of the Bundesliga.
Second-placed Bayer Leverkusen could only draw 1-1 at Hamburg meaning Bayern could still claim second when the season finishes next weekend.
Striker Mario Gomez opened the scoring for Bayern in the 10th minute, before defender Daniel Van Buyten made it two shortly after the half-hour mark.
Bayern scored an incredible six goals in the second half -- Arjen Robben helping himself to a brace as did French midfielder Franck Ribery, while Gomez went on to complete his hat-trick four minutes from the end.
Defender Marcel Eger scored a consolation goal for the hosts in the 78th minute but it was far too late for St Pauli to avoid their 20th league defeat of the season.
But fellow strugglers Borussia Moenchengladbach are still in with a chance of completing a miraculous escape from relegation after they beat Freiburg 2-0 to record their third straight victory.
The result lifts them to 16th, level on 35 points with Wolfsburg, who lost 2-1 to Kaiserslautern.
Seventeenth-placed Eintracht Frankfurt must beat Borussia Dortmund in their final game next weekend to avoid the drop after they lost 2-0 at home to Cologne.
In other matches, Hannover lost 2-1 to Stuttgart meaning they can finish no higher than fourth, while the win sees Stuttgart move up to 11th place in the table with 42 points.
Newly-crowned league champions Dortmund lost 2-0 at Werder Bremen, while fifth-placed Mainz ensured they will play in next season's Europa League after a 3-1 win at Schalke, who completed a miserable week after their Champions League exit to Manchester United on Wednesday.