The striker was chasing a record that stood for almost half a century by former Bayern Munich star Gerd Muller, who knocked in a brilliant tally of 40 in the 1971/72 season.
Lewandowski equalled the record during Bayern's draw at Freiburg last weekend and had one more match to be out there on his own.
It looked like he wasn't going to get it even though the Bavarians raced to a 4-0 lead at half time against Augsburg thanks to strikes from Serge Gnabry, Joshua Kimmich and Kingsley Coman as well as a Jeffrey Gouweleeuw own goal.
Augsburg pulled two goals back after the break and while there was never any danger of Bayern not winning, time was running out for the Poland international to break the record.
But Lewandowski got the record in the nick of time as he scored in the 90th minute at the Allianz Arena.
It was a classic strikers goal as Lewandowski took advantage of Rafal Gikiewicz spilling a long-range effort. Bayern's no.9 rounded the Augsburg goalkeeper before slotting into an empty net.
At 32, this was one of Lewandowski's final opportunities to beat the record. But how long will the record be his?
Borussia Dortmund star Erling Haaland looks like he has what it takes to break it one day though.
The Norwegian continued his incredible streak with a double in Dortmund's 3-1 win over Bayer Leverkusen. Haaland finished the season with 41 goals in as many appearances for the Yellows.