Stuttgart will play Europa League football next season after they reached the DFB-Pokal final by beating Freiburg 2-1 at home in the semi-finals.
Arthur Boka gave Stuttgart the lead after nine minutes with Jan Rosenthal equalising for Freiburg in the 14th minute.
However, Martin Harnik gave Stuttgart the win with his goal in the 29th minute.
Stuttgart's victory sets up a date with record champions Bayern Munich in the final in Berlin on June 1.
Stuttgart have won three DFB-Pokal titles - the last dating back to 1997 - and with Bayern having already qualified for Europe, they will play on the continent next year win or lose.
Stuttgart, who are 12th in the Bundesliga with five rounds left, will automatically qualify for at least the qualification round of the Europa League. They will reach the group stage if they beat Bayern in the final.
Stuttgart started with a series of chances straight away but Harnik shot wide left in the third minute and had other shots stopped by Freiburg keeper Oliver Baumann.
The hosts did grab the lead in the ninth minute, though, as Ibrahima Traore collected a pass down the left wing and squared it into the middle where Boka hit home from 13 yards out.
Freiburg, who were making their first appearance in the DFB-Pokal semis, equalised just five minutes later with Max Kruse feeding a long ball to Rosenthal, who beat Stuttgart keeper Sven Ulreich with a low shot into the left corner.
Stuttgart reclaimed the lead in the 29th minute as Christian Gentner crossed from the left side to Harnik, whose header went off the lower half of the crossbar and in.
The hosts continued to march forward with chances but Gentner's blast went just wide right in the 50th minute and Freiburg defender Pavel Krmas saved Vedad Ibisevic's shot on the goal-line three minutes later.
Freiburg were close to equalising in the 70th minute but Ulreich did a good job fending away Kruse's deflected shot, while at the other end Baumann kept Freiburg in the match by stopping Harnik in a one-on-one situation in the 86th minute.