The 30-year-old Germany international has made more than 500 appearances and won 16 major honours with Bayern since his debut in 2009.
“This club is not just any old employer for me. It’s my passion,” said Muller, who has scored 116 Bundesliga goals.
“I’m happy that I’ll be here for two extra years, and I’ll give everything on and off the pitch.”
Bayern are four points clear at the top of the Bundesliga, which has been suspended until at least 30 April because of the coronavirus pandemic.
“I’m sure that once we’re playing again, we’ll continue to be very successful. That spurs me on,”