The 27-year-old England international, who made history by becoming the most expensive teenager when he transferred from Southampton to Old Trafford in 2014, has been rewarded after contributing significantly to Erik ten Hag's team during the Dutchman's first few months in command at Old Trafford.
Shaw, who has made 249 appearances for United, said on the club's website that he was delighted to be extending his stay after signing for the organization nine years ago.
"Since moving to Manchester all those years ago, I've developed significantly, both as a person and as a player; I now understand what it takes to be successful at a team like this.
"Under the manager and his coaching team, we're just starting out. Even though we've already had success this season, we still want much more. This is a fantastic chance to start something unique, and I will do anything to be a part of it."
Shaw was a member of the United team that ended a six-year title drought by winning the League Cup in February.
As they take on Sevilla in the Europa League quarterfinals and Brighton in the FA Cup final four, the Red Devils are vying for more trophies.
But three games without a win in the Premier League has seen them drop outside the top four.
"Luke is a crucial member of the team and has developed into one of the best defenders in the world, according to United football director John Murtough.
He has worked at the club for almost ten years and is aware of the high standards, as well as the demands for success, that must be met."