Matic, 33, will reunite with former manager Jose Mourinho, who signed him during his spells with United and Chelsea.
"I am pleased and honoured to be joining this club and I cannot wait to start the new season with my teammates," Matic said in a statement.
"Roma is a big club, with amazing fans and a coach, Jose Mourinho, who is well known to everyone - making the decision to come here very straightforward."
🆕 𝗪𝗘𝗟𝗖𝗢𝗠𝗘 | Nemanja Matic 🐺🇷🇸— AS Roma English (@ASRomaEN) June 14, 2022
The club is delighted to confirm the Serbian midfielder as our first signing of the summer - and proud to continue to raise awareness in the search for missing children all around the world. ❤️
#ASRoma | @ICMEC_official pic.twitter.com/pwOtr8id5M
Matic, who left Old Trafford on a free transfer, offers experience to Mourinho's side with 48 caps for Serbia and three Premier League titles.
"Nemanja brings with him to Roma not just a lot of quality on the pitch, but the vast experience he has gained from so many seasons in the Premier League and a focus and mentality that has consistently set him apart throughout his career," Tiago Pinto, the club's general manager said.
"The enthusiasm he showed at the prospect of joining our project was hugely encouraging and I am sure that will serve as a starting point for a very productive journey for all of us."