Matic has been rewarded for his fine form during the second half of the season. He had his contract extended for a year until 2021 in March but has now agreed fresh terms.
Insider Notebook: Pogba open to new United deal
- What did you miss? The latest from Europe's top leagues
- Transfer Q&A: How will summer transfers work?
The 31-year-old, signed from Chelsea for £40m in 2017, started just three times in the Premier League between August and January but has since become a key part of Ole Gunnar Solskjaer's team, failing to start just two league games since the turn of the year.
He has made 27 appearances in all competitions this season, scoring in the 1-0 win over Manchester City in the Carabao Cup in January.
Matic, who won two Premier League titles at Chelsea, has played 114 games for United in three years, scoring four times.
"I am very happy that I will continue to be part of this great club," Matic told the club's website. "As a player, 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."
After initially failing down the pecking order under Solskjaer, Matic looked close to an exit but the club triggered a one-year extension in his contract in March.
He has since established himself in the Norwegian's first choice midfield alongside Bruno Fernandes and Paul Pogba with the trio starting the last three league games against Sheffield United, Brighton and Bournemouth.
"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," Solskjaer said.
"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."