Borussia Dortmund secured their place in the Champions League for next season as Raphael Guerreiro, Marco Reus and Julian Brandt scored in a 3-1 win at Mainz on Sunday.
Guerreiro and captain Reus hit first-half goals before Germany winger Brandt made sure of the three points with a late effort.
With one game left, Dortmund, who routed Leipzig 4-1 to win the German Cup in midweek, cannot finish outside of the Bundesliga's top four.
Mainz striker Robin Quaison claimed his 30th Bundesliga goal by netting a 90th-minute penalty.
Qualifying for Europe caps a remarkable turnaround by Dortmund in the last six weeks.
They were fifth and seven points from the Champions League places after losing 2-1 to Eintracht Frankfurt in early April.
Dortmund have since won all six league games to guarantee a place next season in the group stages of the Champions League.
"Not many people believed in us," Dortmund captain Reus told Sky when asked about bridging the seven-point gap.
"The team deserves an incredible compliment. We have shown a really strong mentality in the last few weeks.
"When we have to, we are capable of great things."
Dortmund's purple patch has extended to the German Cup, winning Thursday's final after Jadon Sancho and Erling Braut Haaland both scored twice in Berlin.
Qualifying for Europe also reduces the chance of star striker Haaland leaving at the end of the season.
The 20-year-old has made no secret of the fact he wants Champions League football and his agent Mino Raiola has recently fuelled speculation the Norwegian could leave.
Haaland has a contract until 2024, but there is reportedly a release clause which becomes active in 2022.
Dortmund are adamant he is staying, with sports director Michael Zorc insisting Haaland "will play for us next season" before kick-off Sunday.
- Haaland assist -
In their previous home game, Mainz pulled off a shock 2-1 win over Bayern Munich, who have since been confirmed Bundesliga champions, but Dortmund allowed no such repeat.
Dortmund took the lead when Guerreiro unleashed an unstoppable shot from the edge of the area on 23 minutes.
The visitors kept up the pressure and Dortmund had appeals for a handball turned down when a Reus flick caught the hand of Mainz defender Alexander Hack.
Reus got on the scoresheet when Sancho ghosted past defenders and squared the ball for his captain to tap home three minutes from the break.
There was a ten-minute delay to the second-half after a storm drenched the Mainz pitch, but Dortmund picked up where they left off.
Just after coming on, Brandt fired home having combined with Haaland after the pair opened up the Mainz defence ten minutes from the whistle.
There was still time for Quaison to become his club's all-time top scorer in Germany's top flight.
Later, Wolfsburg also secured their Champions League place as attacking midfielder Maximilian Philipp scored both their first-half goals in a 2-2 draw at RB Leipzig, which benefited both sides.
The point at home secured the runners-up spot for Leipzig.
Three days after finding themselves 3-0 down at half-time in the German Cup final, Leipzig were again caught napping at home to Wolfsburg.
With his side 2-0 down at half-time, Leipzig coach Julian Nagelsmann, who will take charge of Bayern Munich next season, responded by bringing on Spanish left-back Angelinho and Malian midfielder Amadou Haidara.
The double substitution lifted the hosts as Justin Kluivert pulled a goal back within six minutes of the restart before captain Marcel Sabitzer converted a penalty after Wolfsburg midfielder Paulo Otavio fouled Haidara.
The draw leaves Wolfsburg fourth, but level on 61 points with Dortmund in third.