The Spanish club stated that the move is “in response to the will and request expressed” by Ronaldo, who has spent the past nine years at the Bernabeu.
The fee paid by the Serie A champions is reported to be around €105 million (£92.7 million) for the five-time Ballon d’Or winner.
A Real Madrid statement read: “Real Madrid CF communicates that, in response to the will and request expressed by the player Cristiano Ronaldo, he has agreed to transfer to Juventus FC.
“Today, Real Madrid wants to express its gratitude to a player who has proved to be the best in the world and who has marked one of the brightest times in the history of our club and world football.”
Ronaldo, 33, joined Real from Manchester United in 2009 for a then-world record fee of £80 million.
He has since averaged over a goal a game in scoring 451 times for Real and is the club’s record marksman.
Ronaldo has won the Champions League four times at Real, as well as three FIFA Club World Cups, two LaLiga titles and two Copa del Rey crowns.
The statement added: “Beyond the conquered titles, the trophies achieved and the triumphs achieved in the playing fields during these nine years, Cristiano Ronaldo has been an example of dedication, work, responsibility, talent and improvement.
“For Real Madrid, Cristiano Ronaldo will always be one of his great symbols and a unique reference for the next generations. Real Madrid will always be your home.”