However, the win over Hoffenheim was marred by defensive errors which could prove costly if repeated against Bayern's title rival Leipzig in the league on Sunday. Bayern went behind to an own goal for the second cup game in a row when Jerome Boateng turned the ball into his own net in the eighth minute while trying to block a shot with his shin.
Four minutes later, it was the turn of Hoffenheim's Benjamin Hübner to score an own goal by deflecting a cross past the goalkeeper with his knee to make it 1-1. Thomas Müller put Bayern into the lead in the 20th off a cross from David Alaba. Lewandowski scored in the 36th and 80th minutes to move to 35 goals in all competitions this season — that's 22 in the Bundesliga, 10 in the Champions League and three in the cup.
Hoffenheim wasted a string of second-half chances, but Moanes Dabbur took advantage of mix-ups in Bayern's defense to score two late goals which left Bayern under pressure. Dabbur's second came from a rebound after Bayern's Benjamin Pavard smashed the ball against his own post.
Earlier, Bayer Leverkusen needed a dose of luck to beat second-tier Stuttgart 2-1. Stuttgart's goalkeeper Fabian Bredlow completely mistimed a punch at a corner and deflected the ball into his own net to give Leverkusen the lead in the 71st.
Bredlow was partly to blame for Leverkusen's second 12 minutes later, fumbling a rebound into the path of Lucas Alario, who made it 2-0. Stuttgart hit back with a goal from Silas Wamangituka in the 85th but Leverkusen clung on to win.
Fourth-tier Saarbrücken became the only lower-league team to reach the quarterfinals after beating Karlsruhe 5-3 on penalties following a 0-0 draw. Saarbrücken had to win a regional cup competition last year just to qualify for the German Cup and has since beaten three teams from higher divisions, including Bundesliga side Cologne in the second round.
Union Berlin narrowly avoided extra time against fourth-tier Verl, taking a 1-0 win when Robert Andrich scored in the 85th minute. It's the first time Union has reached the quarterfinal stage since it 2001, when it lost the final to Schalke.
More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports