Bundesliga leaders Bayern Munich scored two goals in injury time to beat lowly St Pauli.
Andreas Hountondji, on loan from Burnley, gave the visitors an early surprise lead after Bayern gave the ball away several times.
Lennart Karl and Tom Bischof both hit the woodwork as Bayern probed for an equaliser.
The leveller did come late in the first half when Luis Diaz, on the ground, flicked the ball on with his heel for Raphael Guerreiro to lash home.
Bayern striker Harry Kane smashed an effort off the post in the second half.
And three minutes into injury time, ex-Liverpool man Diaz headed home from Joshua Kimmich's cross.
Substitute Nicolas Jackson, on loan from Chelsea, added a late third as St Pauli threw players forward.
Bayern have won 11 and drawn one of their league games this season - with Wednesday's 3-1 Champions League loss at Arsenal their only defeat so far.
St Pauli remain in the relegation zone after that late heartbreak.