BERLIN (AP) -- Bayern Munich ground out a hard-fought 2-0 victory over bottom side Eintracht Braunschweig on Saturday to end the champions' three-game winless streak in the Bundesliga.
Claudio Pizarro broke the deadlock in the 75th minute, when Mario Goetze sent the Peruvian through, and Mario Mandzukic secured the win with four minutes remaining as the home side pushed for an equalizer.
Bayern failed to impress for long periods, however, and will hope for improvement for Wednesday's Champions League semifinal first leg at Real Madrid.
"It was important to win before the game against Real Madrid. It gives us confidence," Pizarro said.
Second-place Borussia Dortmund secured Champions League football next season by defeating visiting Mainz 4-2, and Freiburg took a giant step in its fight against relegation by beating Borussia Moenchengladbach by the same score.
"My players ... somehow worked out their luck today," Freiburg coach Christian Streich said.
Augsburg drew 0-0 with Hertha Berlin, while Werder Bremen came from behind to beat Hoffenheim 3-1 and end its relegation fears.
Wolfsburg defeated Hamburg 3-1 away in the late game to move provisionally fourth and leave the home side contemplating its first relegation from the Bundesliga.
Ivan Perisic put visiting Hamburg ahead in the second minute after a great through ball from Luiz Gustavo, Kevin de Bruyne scored in the 31st, and Ivica Olic made it 3-0 four minutes after the break.
Though Ivo Ilicevic pulled one back in the 58th, it might have been worse for the home side. Rene Adler was forced into at least two crucial saves, and Luiz Gustavo hit the post and the crossbar. The Brazilian was shown his second yellow card in the final minute.
"We won hardly any challenges. We simply weren't there," Hamburg midfielder Hakan Calhanoglu said.
Hamburg, the only side to have played every Bundesliga season since the league's formation in 1963, remains in the relegation playoff place, but could be overtaken on Sunday if Nuremberg beats Bayer Leverkusen, which can reclaim fourth.
Bayern coach Pep Guardiola started arguably his strongest available side to fine tune for the trip to Madrid. Nevertheless, the home side frustrated the visitors through determined tackling, constant running, and a clear desire to avoid an immediate return to the second division.
The effort eventually took its toll as players tired and Guardiola swung the game in Bayern's favor in the 73rd, with the introduction of Thomas Mueller and Mandzukic for Franck Ribery and Arjen Robben.
Despite TV replays showing he may have been offside when receiving the ball, Goetze unlocked the Braunschweig defense for Pizarro to hammer the ball under the crossbar.
A long kick out from Lukas Raeder, making his first league start in goal, allowed Mandzukic to seal the win with his 18th goal of the season. Only Dortmund's Robert Lewandowski, who will replace or challenge the Croat for a starting place next season, has as many goals.
Lewandowski scored again against Mainz as Dortmund assured itself of at least third place.
Milos Jojic got Dortmund underway in the sixth minute with a 20-meter shot that took a deflection from Oliver Kirch's right hand. TV replays showed the Dortmund defender tried to take his arm out of the way.
Shinji Okazaki equalized with another deflected effort in the 14th, but Lewandowski restored the home side's lead four minutes later, when Henrikh Mkhitaryan set up the Poland striker to finish coolly.
Okazaki intercepted an inexplicable back-pass from Nuri Sahin to equalize again in the 54th, but Lukasz Piszczek made it 3-2 to Dortmund three minutes later, with a backward header from Marco Reus' free kick.
Reus then secured the result from the penalty spot in the 79th, after Niko Bungert was sent off for blocking Lewandowski's goalward shot with his arm.
"It was outstanding what my squad delivered today," Dortmund coach Juergen Klopp said. "Another nine points from the last three games and everything is well."
Freiburg denied Moenchengladbach the chance to go provisionally fourth, with the game turning after Freiburg goalkeeper Oliver Baumann saved Filip Daems' penalty and Moenchengladbach midfielder Granit Xhaka was sent off for his second booking with the score still 1-1.