The 26-year-old has been a key figure in the middle of the pitch for Bayern since his arrival in 2018, and he remains a consistent name on the team sheet for Julian Nagelsmann's side, having started all four Bundesliga fixtures so far this season.
Goretzka's current deal with the German giants is due to expire next summer, and negotiations for a new deal were reportedly delayed as Man United and Los Blancos came into the mix for his signature.
However, Bavarian Football Works reports that the talks have now been concluded and the club have agreed a new deal with the midfielder, which will keep him in Munich until 2026.
Bayern have been busy extending contracts this past year, and Goretzka will join a list of key players who have all agreed new terms, including Thomas Muller, Manuel Neuer, Alphonso Davies, Jamal Musiala and Joshua Kimmich.
The German international has scored 25 goals and provided 26 assists in 117 appearances for the club.