Muller came through the ranks at Bayern Munich and has been with the senior team since making his debut in the 2008-2009 season.
The 30-year-old’s contract was due to expire in 2021 and was linked with a move away from Munich in recent seasons.
Moments after extending his stay in Bavaria, the 2014 World Cup winner said he is happy for this new deal and insists he will keep fighting for Bayern Munich.
"Both sides signed with a really good feeling. I'm sure that once we're playing again, we'll continue to be very successful.”
“That spurs me on. For me, the number one priority was to extend at FC Bayern - and the club felt the same way.”
"I've been with FC Bayern for a good two-thirds of my life now, so you can't say that the club and I are just along for the ride - we fight for each other.”
“This club is not just any old employer for me. It's my passion. I'm happy that I'll be here for two extra years, and I’ll give everything on and off the pitch," he added.
Bayern Munich CEO Karl-Heinz Rummenigge said he is pleased with Muller’s extension and he thanked his compatriot and his advisor for their commitment.
"I'm pleased that Thomas Müller has extended his contract by a further two years until 30 June 2023. I would like to thank Thomas and his advisor Ludwig Kögl for the very trusting and fair talks."
"Thomas is a special player for us, a figurehead for the club and our fans, a leader who shows the way on the pitch and has achieved a lot with FC Bayern," added sporting director Hasan Salihamidzic.
Muller has made 521 appearances for Bayern and has won eight Bundesliga titles, five German Cups and five German Super Cups in addition to the 2013 Champions League.