The Poland international is said to have been in discussions over extending his terms since the summer, leading to suggestions that he was deliberately stalling in an attempt to move elsewhere.
Real Madrid and Manchester City, where former Bayern boss Pep Guardiola is now in charge, had both been linked with Lewandowski ahead of the January window, but the 28-year-old has now inked a deal at the Allianz Arena until 2021.
"I am very pleased that the negotiations have led to a positive result and that I will remain at FC Bayern," he told the club's official website. "Together we still have great goals [to achieve]."
Lewandowski, who top-scored in the Bundesliga last term with 30 goals, is thought to have seen his pay increase from £8.5m a year to around £13m to put him in line with Bayern's highest earners.