Robert Lewandowski broke Gerd Muller's long-standing record for goals scored in a single Bundesliga season with a last-gasp effort as Bayern Munich routed Augsburg 5-2 on a day of fond farewells.

The prolific Pole could only watch on as an own goal plus efforts from Serge Gnabry, Joshua Kimmich and Kingsley Coman had the champions flying at half-time of the season finale at the Allianz Arena.

But, after consolations from Andre Hahn and Florian Niederlechner, Lewandowski followed in when Rafal Gikiewicz spilled Leroy Sane's effort to make it 41 top-flight goals for the season with the last kick of the game.

It was a dramatic ending to an emotional outing, which was the last for head coach Hansi Flick and modern-day Bayern greats David Alaba, Jerome Boateng and Javi Martinez.

Bayern led when Jeffrey Gouweleeuw inadvertently turned in Gnabry's drilled cross.

Gnabry then headed into an unguarded goal after Coman had struck the post and Gikiewicz had twice denied Bayern all in one breathless move.

Manuel Neuer maintained Bayern's advantage by parrying away Daniel Caligiuri's penalty, awarded when Benjamin Pavard clipped the heels of Niederlechner.

Kimmich's drilled 30-yard effort into the top-right corner was in stark contrast to a desperate Lewandowski, who missed three chances either side of that thunderbolt.

Coman's low drive into the bottom-left corner made it 4-0 before the break and Lewandowski was foiled again shortly before the hour by a last-gasp challenge from Gouweleeuw.

Augsburg replied first through Hahn's header from Laszlo Benes' whipped free-kick, with scorer turning provider for Niederlechner to coolly slot past Neuer.

Just when it looked like Lewandowski would agonisingly miss out, he reacted quickest when Gikiewicz could only parry Sane's effort, rounded the goalkeeper and slotted into an empty goal before whipping off his shirt in sheer jubilation.