The 27-year-old midfielder heads to France after 14 years around the Barcelona setup, having joined the club as a 13-year-old.
Rafinha has been in and out of Barcelona's senior squad since 2011, and has spent last season on loan at Celta Vigo.
In a statement announcing the transfer, Barcelona said: "FC Barcelona would like to publicly thank Rafinha for his commitment and dedication and it wishes him all the best for the future.
"He leaves the club having played a part in winning eleven major trophies, including the Champions League, three Ligas and three editions of the Copa del Rey, having scored 12 goals in 89 games."
Rafinha, who was part of the Brazil side which won gold at the 2016 Olympics, will wear the number 12 shirt at the Parc des Princes.