VfB Stuttgart edged past surprise package Freiburg 2-1 on Wednesday to set up a German Cup final against Bayern Munich and secure a European spot for next season.
With Bayern having already clinched the Bundesliga title this season, Stuttgart, 12th in the league and off the European spots, are assured a place in next season's Europa League even if they lose the June 1 final in Berlin.
Their joy was shortlived, however, when Jan Rosenthal sprinted clear and beat keeper Sven Ulreich with a well-placed shot in Freiburg's first offensive foray in the 14th.
Austria international Martin Harnik, who had missed a huge chance in the opening minutes, restored Stuttgart's lead with a close-range header off the bar on the half hour.
"These are special moments and that is why we do this job," said Stuttgart coach Bruno Labbadia, whose team competed in the Europa League this season but had a disastrous start to the new year.
"My team fought with everything they had. This team has gone to its limits constantly in the past 2-1/2 years and now it is being rewarded for it."
Freiburg, who are fifth in the Bundesliga and on track to qualify for European football next season, tried to come back.
But keeper Ulreich denied Max Kruse with a fine save in the visitor's only good effort in the second half as the 59,000 Stuttgart fans started celebrating and chanting "We are going to Berlin".
Photograph: Lisi Niesner/Reuters
Bayern crush Hamburg 9-2 to stride towards title
Real Madrid dethrone United to become Most Valuable Team
Lewandowski goal delays Bayern title party
Shaqiri, Gomez steer Bayern to Cup final
Dortmund hit six and Bayern four in easy wins