Shaw, 23, was in the final year of the deal he signed four years ago when joining from Southampton as the world’s most expensive teenager at the time.
However, his time at Old Trafford has been blighted by a horrific leg break in 2015 that forced him to consider retiring and public criticism from United manager Jose Mourinho.
“It’s been an odd four years for me,” admitted Shaw.
“There have been ups and downs. From signing today now it’s all about looking forward and to how much I can help the team and become a success again.
“If you look at my situation in the last year and a bit, you’d have thought this could have been impossible. But I worked hard, I wanted to be here and I wanted to make sure my future was here to help this club.”
Shaw has been rewarded for an excellent start to the season personally despite a difficult time for Mourinho’s men as a team.
United trail Premier League leaders Chelsea, Liverpool and Manchester City by seven points after eight games with speculation surrounding how long Mourinho will keep his job.
“I think personally it’s only a matter of time that the success is going to be coming back,” added Shaw.
“I can see the team that we have here. We have an amazing group of players and the talent we have is scary, there are a lot of young lads that are hungry for trophies.”
Despite their previous differences, Mourinho has been won over by Shaw’s start to the campaign and insisted he was deserving of his new deal.
“Luke fully deserves this contract. He understood his development process, he has worked really hard at every level and he always believes in himself which is a great attribute to have,” said Mourinho.
“Luke is still young and is improving all the time and he must feel very proud of himself.
“I am delighted that we are keeping such a talented young English player with a bright future ahead of him.”
For more news your way, download The Citizen’s app for iOS and Android.
Download our app and read this and other great stories on the move. Available for Android and iOS.