Kingsley Coman's extra-time winner spared Mats Hummels' blushes and sent Bayern Munich into the DFB-Pokal quarter-finals courtesy of a 3-2 win over Hertha Berlin.
Niko Kovac's side, who were again missing the injured Manuel Neuer, had hit back following Maximilian Mittelstadt's third-minute opener, with Serge Gnabry scoring a brace.
However, substitute Davie Selke seized upon Hummels' dreadful header back towards Neuer's deputy Sven Ulreich to force extra time.
And it was Coman, with his first goal since December, who won it by heading in from close range.
Bayern felt injustice inside the opening three minutes when Leon Goretzka was booked for diving having gone down in the box, despite Karim Rekik appearing to make contact with him.
The visitors were even more peeved when Mittelstadt fired past Ulreich after the Bayern defence failed to deal with a long ball.
They were behind for just four minutes, Gnabry beating Rune Jarstein at his near post to equalise with a first-time drive after Joshua Kimmich's near-post cross had been cleared to him.
Gnabry's second goal arrived shortly after half-time. Niklas Sule and Robert Lewandowski were involved in the move, which led to James Rodriguez's pass around the corner to Gnabry, who confidently found the bottom-left corner of Jarstein's net.
Bayern were coasting to the next round until Hummels' lapse in concentration handed Hertha a 67th-minute equaliser with just their second shot on goal.
It came from a Bayern error as Hummels failed to realise Selke was lurking behind him, and the substitute easily collected the ball and rolled it under Ulreich to make it 2-2.
Bayern still had a great chance to prevent the game from heading to extra time, but James got his body shape all wrong when attempting to steer home David Alaba's cross and diverted the ball wide with his thigh.
Kovac's side then struck eight minutes into the additional period to restore their lead via a scrappy goal that Hertha should have prevented.
Goretzka's nod down from Kimmich's cross was latched onto by Lewandowski and he hooked the ball over Jarstein and into the air, with Coman beating three defenders on the line to head in.
What does it mean? Bayern clear favourites to lift trophy
It might not have been a vintage performance but Bayern are into the quarters as they bounced back following their league loss at Bayer Leverkusen. With Bundesliga leaders Borussia Dortmund and Borussia Monchengladbach among the teams already eliminated, Kovac will fancy his chances of winning the competition for the second straight year having led Eintracht Frankfurt to glory in 2017-18.
Super Serge makes starting case
Gnabry has not started a Bundesliga game for Bayern since before Christmas but he should be one of the first names on Kovac's teamsheet for the clash with Schalke. Both of his goals were emphatic finishes and his willingness to drift in off the right flank caused Hertha headaches all match.
Hummels rolls out the welcome Mats
Hertha had not had a shot after their early opener before they got a helping hand for their second goal. Selke may have read Hummels' attempted header back, yet it was far too weak anyway and gave Ulreich no chance of cleaning up the mess. For a World Cup winner like Hummels, it was an inexplicable piece of 'defending'.
Kovac's side will bid to get back to winning ways in the Bundesliga against Schalke in Munich on Saturday, while on the same day Hertha travel to Borussia Monchengladbach, who are one of two teams above Bayern in the table.
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.