United announced shortly before 5pm on Friday they had secured a deal with the Italian outfit that was subject to the agreement of personal terms, a medical and a visa.
It capped a remarkable turn of events after reports just hours earlier had suggested the 36-year-old five-time world player of the year was poised to sign for rivals Manchester City.
United said in their announcement: “Everyone at the club looks forward to welcoming Cristiano back to Manchester.”
It is understood United will pay 15m euros (£12.85m) plus eight million euros (£6.85m) in potential add-ons.
Ronaldo scored 118 goals in 292 appearances for United between 2003 and 2009 before leaving Old Trafford for Real Madrid, where his successes included four Champions League successes.
Ronaldo had also been linked with Paris St Germain but City, after missing out on signing Harry Kane from Tottenham, had appeared the favourites to secure his services.
The champions are understood to have been offered the player but, after giving a potential deal some consideration, decided it was not something they wished to pursue.
They felt Ronaldo was not the right fit for Pep Guardiola’s squad and, despite the Kane frustration, the manager himself is happy enough with the players he already has.
For their part, United had not been looking to sign Ronaldo but seized the opportunity when it became clear he wanted to leave Juve.