The 31-year-old Poland international is now starting his sixth season in Bavaria, and has plundered five goals in two league games already.
He has hinted at leaving the club over the past 18 months having been linked to Real Madrid, but has now committed himself to Niko Kovac's side.
Bayern CEO Karl-Heinz Rummenigge told the club's website: "For me, Robert is the best centre-forward in the world and has been a mainstay of our team for years.
"Therefore, we are very happy that he will play at for Bayern for a long time to come. We are confident that with Robert, we will achieve our ambitious goals in the coming season and in the years to come."
Since joining from Borussia Dortmund in 2014, Lewandowski has underlined his status as one of the world’s deadliest forwards and one of Bayern’s all-time greats.
He has scored more than 40 goals in all competitions in each of the last four seasons, and sits behind only Gerd Muller and Rummenigge himself in the club’s top scorers list.
While Bayern have struggled to make an impression in the Champions League in recent years, they have won the Bundesliga in each of Lewandowski's five seasons to date and will be looking to repeat the feat by holding off the challenge of Dortmund this year.
"Bayern has become my home town," the forward said. "We also feel very comfortable as a family in Munich. I am convinced that we will achieve a lot in the next few years. Bayern is one of the three biggest clubs in the world and we have an outstanding team. I'm proud to be part of this club."
After starting the season with a brace in the draw against Hertha Berlin, Lewandowski bagged a hat-trick against Schalke over the weekend to help Bayern to their first league win of the season. A repeat performance would see him past the 200-goal mark for the club, as he currently sits on 197.
Lewandowski is now one of the senior players at Bayern, particularly following the departures this summer of long-time wing partners Arjen Robben and Franck Ribery.
And as Kovac aims to put his stamp on the team in the coming years, the reliable brilliance of Lewandowski will surely continue to be key.
Sporting director Hasan Salihamidzic said: "Robert has become a leader and is in the process of becoming as important a player for Bayern and our fans as Franck Ribery and Arjen Robben have been. I hope he can continue his outstanding scoring record over the next few years."