Shaw is approaching a decade at Old Trafford, having joined the club as an 18-year-old from Southampton in the summer of 2014 for £30m.
The 27-year-old England international has made 249 appearances in total for the Red Devils and has won two Carabao Cups and the Europa League in his time at the club.
Shaw has been utilised at both left back and centre back by manager Erik Ten Hag this season, underlying his versatility.
Shaw said of his contract extension: "Nine years ago, I signed for this amazing club, and I'm thrilled to be extending my stay.
"I've grown immensely since coming to Manchester all those years ago, both as a person and as a player; I know what is needed to succeed at a club like this.
"We're at the beginning of our journey under the manager and his coaching staff. We've been successful already this season, but we want much more. There's a great opportunity to create something special here, and I'm going to give everything to be part of that."
Manchester United football director John Murtough said: "Luke is a massively important player to the squad and has grown into one of the best defenders in the world.
"He has been at the club for nearly a decade and understands the expectations for success, and the hard work, commitment and high standards required to achieve it.
"He has added leadership to his other outstanding abilities, and we all look forward to seeing him in a Manchester United shirt for years to come."