BERLIN (AP) -- Schalke clinched Germany's last Champions League spot by winning 2-1 at Freiburg in the final round of Bundesliga games on Saturday, while Fortuna Duesseldorf was relegated after losing 3-0 at Hannover.
The 19-year-old Julian Draxler gave Schalke the lead in the 20th, cutting inside a defender from the edge of the area and shooting inside the far post on his 75th Bundesliga appearance.
Jonathan Schmid equalized in the 54th, but any hopes the home side had of leapfrogging Schalke for fourth-place were dashed four minutes later, when Immanuel Hoehn's clearance from Jermaine Jones' shot rebounded off the unfortunate Julian Schuster and in.
"Such a showdown, it was pure drama and excitement. I'm exhausted but very happy that we've reached our aim,'' said Schalke coach Jens Keller, who could have been talking about the day's action.
Hoffenheim escaped automatic demotion with a come-from-behind 2-1 win at Borussia Dortmund, but still faces a playoff to stay in the top flight. Augsburg took advantage of Duesseldorf's loss by beating bottom side Greuther Fuerth 3-1 to clinch survival, and Eintracht Frankfurt drew 2-2 with Wolfsburg to join Freiburg in next season's Europa League.
"We're really looking forward to the coming games,'' said Frankfurt coach Armin Veh, who led the team to promotion last season. "But now I'm happy there are holidays. I'm knackered.''
Bayern Munich twice came from two goals down to win 4-3 at Borussia Moenchengladbach, equaling its feat from 1986-87 of finishing with an unbeaten away record.
Bayern wrapped up the title with a record six games to spare and finished with 91 points, 25 ahead of Dortmund, both records.
Elsewhere, Bayer Leverkusen won 1-0 at Hamburger SV thanks to league top-scorer Stefan Kiessling's last minute strike, his 25th of the season.
"It was simply a great season,'' said Kiessling, whose side had already clinched third place.
Stuttgart drew 2-2 at home with Mainz, and Nuremberg beat Werder Bremen 3-2 in the visitors' first game in 14 years without coach Thomas Schaaf.
Robert Lewandowski claimed his 24th of the campaign for Dortmund from a rebound after Koen Casteels saved Jakub Blaszczykowski's initial effort.
Dortmund dominated the game, but failed to make the most of its chances and Hoffenheim was given a lifeline in the 76th, when Mats Hummels bundled Kevin Volland over in the area.
Salihovic equalized from the penalty spot a minute later, and the Bosnian displayed cool nerves to blast home another spot kick five minutes later, after Dortmund goalkeeper Roman Weidenfeller was sent off for bringing down Kevin Schipplock.
Dortmund defender Marcel Schmelzer thought he'd scored in injury time, sending Hoffenheim directly down, but the goal was eventually ruled out with Lewandowski in an offside position.
"The end was very emotional. We're happy now that we still have the chance to stay in the league,'' said Hoffenheim coach Markus Gisdol, whose side now faces two games against Kaiserslautern, the third-place finisher in the second division, to determine which side plays top flight football next season.
Dortmund now has injury worries over Hummels, who limped off after conceding the penalty and is a doubt for next Saturday's Champions League final against Bayern at Wembley.
"His ankle is swollen. That's not good. It will be close for Saturday,'' Dortmund coach Juergen Klopp said. "Now we're drawing a big thick line through the Bundesliga season and want to make sure all our players are fit for the final.''
Bayern coach Jupp Heynckes was given a rousing reception from both sets of fans ahead of his last Bundesliga game in charge.
Heynckes began his career as a prolific striker at home club Moenchengladbach before clocking up 1,011 Bundesliga games as player or coach. The 68-year-old is making way for former Barcelona coach Pep Guardiola and has indicated he won't coach in Germany again.
Moenchengladbach got off to a flying start with Martin Stranzl heading past Manuel Neuer in the fourth minute and Mike Hanke slotting past the goalkeeper in the next.
Franck Ribery set Javi Martinez free to pull one back two minutes later, but Havard Nordtveit claimed the home side's third on a counterattack three minutes after that.
Ribery saved his side's blushes by slotting inside the near post in the 18th, equalizing with a stunning volley in the 53rd, and then setting up Arjen Robben to score Bayern's fourth goal six minutes later.
"I said that this will be my last Bundesliga game, here where I began in 1964. I noticed the players were pleased afterward that they gave me this gift,'' said Heynckes, who fought back tears in the post-match news conference.
On his club record 300th Bundesliga appearance for Hannover, American defender Steve Cherundolo set up Mame Diouf to score in the 36th.
Didier Ya Konan scored Hannover's second in the 61st and sealed Duesseldorf's fate in the 76th.
"I was never relegated before, neither as a player nor a coach. Believe me, it doesn't feel good,'' said Duesseldorf coach Norbert Meier.