The 23-year-old Scotland international came through the Manchester United academy and was given his first taste of first team action by Jose Mourinho in May 2017 in a Premier League game against Arsenal.
He has since gone on to make 52 top flight appearances for the Old Trafford club, scoring six goals.
"Whilst I understand that we all have so many other things to think about at the moment, I'm so happy to sign this contract and play a part in the future ahead for this team," he said via United's website.
"All I have ever known is United and I hope that my passion for the club shows every time I go onto the pitch. I'll continue to give everything for this club whenever I pull on the shirt.
"I want to thank the manager for the faith he has shown in me and everyone at the club that has helped me to get where I am today. I'm looking forward to finishing this season on a high and hopefully achieving our aims."
Manchester United manager Ole Gunnar Solskjaer said: "Scott has done tremendously well since I joined and has been a vital part of our midfield. He brings determination, tenacity and skill to the game and we know that Scott's attributes will be a major asset to the squad over the coming years.
"As we always say the academy is the bedrock of the club and having come through the system everyone knows that Scott has shown the exact mentality that you need to succeed at Manchester United. I look forward to seeing his continued improvement in the years to come."