Robert Lewandowski scored the latest Bundesliga goal since Opta's records began with his last-gasp goal in Bayern Munich's 1-1 draw with Hertha Berlin.
Carlo Ancelotti's men looked destined to defeat at the hands of the capital club, who took the lead in the 21st minute with a Vedad Ibisevic strike.
But Polish striker Lewandowski, 28, came off the bench to tap in for the German league leaders with 95 minutes and 59 seconds on the clock.
Since Opta's statisticians began keeping in track in the 2004-05 season, no one has scored a goal that late in the Bundesliga.
It was Lewandowski's 25th goal of the campaign and the 16th he's scored in the league in 2016-17 - only Borussia Dortmund's Pierre-Emerick Aubameyang is ahead of him in the goalscoring standings.
Bayern are now eight points clear of second-placed RB Leipzig, who have a game in hand, with Dortmund a further five points off the pace.
The Bavarians have games against Hamburg, Schalke and Koln to look forward to before visiting Arsenal on March 7, where they are expected to retain their aggregate lead having won the first leg of the Champions League last 16 tie 5-1.