Borussia Dortmund capitalized on a favor from Schalke to secure a spot in the Champions League on Sunday, while Hamburger SV’s hopes of rejoining the Bundesliga were put on hold for another year.

Dortmund won 3-1 at Mainz to be sure of finishing at least fourth to qualify for Europe’s top club competition.

More Images
Dortmund's Erling Haaland, right, vies for the ball with Mainz's Jerry St. Juste during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Borussia Dortmund capitalized on a favor from Schalke to secure a spot in the Champions League on Sunday, while Hamburger SV’s hopes of rejoining the Bundesliga were put on hold for another year.

Dortmund players celebrate their sides second goal scored by Dortmund's Marco Reus during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Eintracht Frankfurt looked set to qualify when it was leading Dortmund by seven points with six rounds remaining, but the team slumped once coach Adi Hütter announced he was leaving for Borussia Mönchengladbach next season. Frankfurt’s 4-3 loss at already-relegated Schalke on Saturday was its third defeat in five games.

Dortmund's Erling Haaland reacts during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

It seemed the celebrations took their toll.

Dortmund's Marco Reus, left, vies for the ball with Mainz's Moussa Niakhate during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

HAMBURG DENIED AGAIN

Mainz's Jerry St. Juste, left, challenges for the ball with Dortmund's Erling Haaland during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports

Dortmund's Erling Haaland, left, celebrates his sides third goal scored by Dortmund's Julian Brandt, right, during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Erling Haaland, left, celebrates his sides third goal scored by Dortmund's Julian Brandt, right, during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Raphael Guerreiro opened the scoring in the 23rd minute, Marco Reus converted from close range in the 42nd, and substitute Julian Brandt sealed the win in the 80th.

Dortmund's Erling Haaland, right, vies for the ball with Mainz's Jerry St. Juste during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Erling Haaland, right, vies for the ball with Mainz's Jerry St. Juste during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Eintracht Frankfurt looked set to qualify when it was leading Dortmund by seven points with six rounds remaining, but the team slumped once coach Adi Hütter announced he was leaving for Borussia Mönchengladbach next season. Frankfurt’s 4-3 loss at already-relegated Schalke on Saturday was its third defeat in five games.

Dortmund’s win on Sunday was its sixth straight, and it lifted Edin Terzić’s side into third place ahead of the late game between Leipzig and Wolfsburg, which needs a point to be mathematically certain of Champions League qualification.

A strong thunderstorm storm delayed the second half after a first half to forget for Mainz. Mainz, which was previously second-last and a strong candidate for relegation, was unbeaten in nine games under new coach Bo Svensson and it clinched survival through others’ results on Saturday.

Dortmund players celebrate their sides second goal scored by Dortmund's Marco Reus during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund players celebrate their sides second goal scored by Dortmund's Marco Reus during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

It seemed the celebrations took their toll.

“No question, we can do better,” Mainz sports director Christian Heidel said at halftime.

Mainz was much improved for the second half but Erling Haaland set up Brandt for his third goal of the season before Robin Quaison got the home side’s consolation with a penalty in injury time.

Dortmund's Erling Haaland reacts during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Erling Haaland reacts during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

HAMBURG DENIED AGAIN

In Germany’s second division, former Bundesliga heavyweight Hamburg lost 3-2 in Osnabrück to end its promotion hopes for the third successive year. Hamburg dropped to fifth and can no longer finish in the top three.

Bochum, Holstein Kiel or Greuther Fürth are seeking to secure automatic qualification as the top two from the final round of games next Sunday, while the other will finish third for a two-leg playoff against the team that finishes third from bottom in the Bundesliga on Saturday.

Dortmund's Marco Reus, left, vies for the ball with Mainz's Moussa Niakhate during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Marco Reus, left, vies for the ball with Mainz's Moussa Niakhate during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports

Ciarán Fahey on Twitter: https://twitter.com/cfaheyAP

Mainz's Jerry St. Juste, left, challenges for the ball with Dortmund's Erling Haaland during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Mainz's Jerry St. Juste, left, challenges for the ball with Dortmund's Erling Haaland during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Erling Haaland, left, celebrates his sides third goal scored by Dortmund's Julian Brandt, right, during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)

Dortmund's Erling Haaland, left, celebrates his sides third goal scored by Dortmund's Julian Brandt, right, during the German Bundesliga soccer match between FSV Mainz 05 and Borussia Dortmund in Mainz, Germany, Sunday, May 16, 2021. (AP PhotoMichael Probst,Pool)