Schalke guaranteed third place in the Bundesliga after Borussia Monchengladbach, the only team who could have overhauled them, were held 0-0 at home by Augsburg on the penultimate day of the season.
Forward Lucas Barrios, left on the bench for most of the season, scored a hat-trick as Borussia Dortmund, crowned champions last week, celebrated with a 5-2 win at relegated Kaiserslautern, their 27th league game without defeat.
Paraguay forward Barrios, a key figure for Dortmund when they won the title last season, has fallen out of favour with the emergence of Robert Lewandowski this term and was making only his third start of the campaign.
Gladbach guaranteed fourth place and a spot in the qualifying rounds of the Champions League, a remarkable achievement after they were nearly relegated last season.
Augsburg, 15th in the table, made sure of top flight football next season as did Hamburg, the only ever-present team since the Bundesliga was founded in 1963, with a goalless draw at home to Mainz.
Hertha, 17th and in the danger zone, were given a stay of execution when Cologne, two points above them in the relegation playoff spot, were thumped 4-1 at Freiburg.
Mensur Mujdza, Karim Guede, Daniel Caligiuri and Sebastian Freis shared the goals for Freiburg as they took full advantage of Cologne's notoriously leaky defence which has conceded 71 league goals this term.
Lukas Podolski replied for the Billy Goats early in the second half.
Hertha and Cologne will now battle to decide who goes straight down and who plays off over two legs against the third-placed side from the second division.
Hertha, promoted last season, host mid-table Hoffenheim in their final game and Cologne face Bayern Munich.
Champions League finalists Bayern, who will finish as runners-up, beat VfB Stuttgart 2-0 with Mario Gomez scoring his 26th league goal of the season, one behind Huntelaar.
Gomez's goal was typically opportunist as he turned the ball into an empty net after a run by Thomas Muller who added the second late in the game for the Bavarians.
Patrick Helmes scored twice to give 2009 champions Vfl Wolfsburg a 3-1 home win over Werder Bremen while Nuremberg won 3-2 at Hoffenheim, helped by a brace from Czech forward Thomas Pekhart.
Schalke, Champions League semi-finalists last season, will be in Europe's showpiece competition for the fifth time.
"Schalke were better than us in every department," said Hertha's 73-year-old coach Otto Rehhagal. "We could see why they are in the Champions League and we are fighting relegation."
"Getting to the Champions League is another challenge for our young team," said Schalke's Dutch coach Huub Stevens.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.