The 31-year-old Serbia midfielder joined United from Chelsea in 2017 and has made 114 appearances in all competitions for the Red Devils.
Matic said in a statement on the United website: "I am very happy that I will continue to be part of this great club.
"I still have a lot more to give and achieve in my career and to do that with Manchester United will be a huge honour.
"This is a really exciting team to be part of, we have a good balance of youth and experience within the squad and there is great comradery amongst the group.
"This is a key part of the season and we are playing well. We will continue to fight to finish the season on a high and make our amazing supporters proud."
United boss Ole Gunnar Solskjaer said: "I am delighted that Nemanja has signed a new contract, I know his experience, professionalism and leadership will be invaluable to this young talented group.
"We have great strength in midfield and Nemanja's attributes are a key part of that. Nemanja has been here for three seasons now and really understands the values of playing for Manchester United.
"He remains hugely ambitious and determined which will be vital as we look to achieve our aims over the coming years."
Matic has started each of United's last three Premier League games and made 16 league appearances in total so far this season.