The defender was told he could leave United earlier this summer after being left out of the squad for the club's pre-season tour of the United States.
The Ligue 1 club announced the 25-year-old defender will sign a four-year deal, until June 2019.
Man Utd want McGinn, Arsenal braced for Mari transfer backlash – Paper Round
Rafael joined United along with his twin brother Fabio from Fluminense in 2008.
Rafael went on to establish himself as a first-team regular under Sir Alex Ferguson and David Moyes, but new manager Louis van Gaal often overlooked the defender, choosing Antonio Valencia ahead of him.
Rafael started just six Premier League games in the 2014-15 season, the last of which came on October 26 against Chelsea.
And when Van Gaal signed right-back Matteo Darmian from Torino this summer, it was clear Rafael was surplus to requirements at Old Trafford.

Manchester United manager Louis van Gaal (2nd L) introduces three new signings: Morgan Schneiderlin (L-R), Bastian Schweinsteiger , and Matteo Darmian, at a press conference in Bellevue, Washington July 15, 2015. REUTERS/Jason Redmond

Image credit: Reuters

"I want to thank Manchester United fans for all the love during those 8 years," Rafael, 25, said on his official twitter account.
"Since I signed with the club I lived incredible moments, after all were 8 years wearing the shirt of one of the biggest clubs of the world.
"Now it's a new path, a new challenge, God bless me!"
On Monday morning, Lyon president Jean-Michel Aulas announced the 25-year-old was in the French city ahead of a potential transfer to the Ligue 1 runners-up.
"Rafael has arrived from Manchester, we are waiting for an agreement with United about his transfer," Aulas tweeted.
"He has the Brazilian good humour."
Reports in France suggest Lyon will pay up to £2.5million for the signature of the three-time Premier League winner.
Later on Monday, the deal was confirmed by both club and player, with Lyon posting a photo of Rafael in attendance to complete the move.
Premier League
'I will never disrespect the club and the fans’ - Martial hits back at Rangnick
16/01/2022 AT 10:45
Premier League
Coutinho grabs late debut goal to deny Man Utd victory at Villa after Fernandes brace
15/01/2022 AT 16:51