Robert Lewandowski has signed a new four-year contract, Bayern Munich have confirmed.

Lewandowski, who has scored five goals in two Bundesliga games this term, has committed his future to the club through to 2023.

The 31-year-old could therefore spend the rest of his career at the Allianz Arena, having established his place as one of the world's top strikers since joining from Bundesliga rivals Borussia Dortmund in 2014.

Lewandowski's new contract is a two-year extension and the striker is thrilled to have secured new terms.

"Bayern has become my sporting home," he told the club's official website. "Besides, my family and I are happily settled in Munich.

"I'm convinced we'll achieve a lot in the next few years. Bayern are one of the three biggest clubs in the world, and we have an outstanding team. I'm proud to be part of this club."

Lewandowski's future was not always certain the Poland international has previously intimated he would consider leaving the club.

Real Madrid were linked with a move for the player, who has previously questioned the lack of back-up for his position in the Bayern squad.

However, it emerged this week a new deal for Lewandowski was close and executive board chairman Karl-Heinz Rummenigge is relieved the contract has been sorted.

"For me, Robert is the world's best centre-forward, and he's been a mainstay of our team for years," Rummenigge said. "So, we're extremely pleased he'll continue to play for Bayern for a long time.

"We're certain that together with Robert we'll achieve our ambitious goals in the upcoming season and in the years to come."

Lewandowski scored his 200th Bundesliga goal in April, reaching the milestone in a Klassiker victory over old club Dortmund as Bayern took a crucial step closer towards another title.

He won the league in all of his first five seasons at Bayern and has been compared to veteran wingers Franck Ribery and Arjen Robben, both of whom left at the end of their contracts, by sporting director Hasan Salihamidzic.

"Robert has developed into a leading personality at the club and is on course to become as important a player for Bayern and its fans as Franck Ribery and Arjen Robben were," Salihamidzic said. "I hope he can maintain his outstanding strike rate in the years to come."

Lewandowski has hit 207 Bundesliga goals for Dortmund and Bayern and is already the most prolific non-German scorer in the league's history.

He is fifth overall in the all-time rankings, having scored at least 20 league goals in seven of his past eight seasons in Germany.

Gerd Muller is Bayern's all-time top scorer on 508 but Lewandowski is only 20 behind second-place Rummenigge, having scored 197 goals in 246 competitive matches for the club.