The Portuguese forward joined Los Blancos from Manchester United in 2009 for a then world-record fee of £80 million.
However, the 33-year-old has now decided to make a change and will now ply his trade with the Old Lady, signing a four-year deal with the club.
A statement from the club 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.
'Beyond the conquered titles, the trophies achieved and the triumphs achieved in the playing fields during these 9 years, Cristiano Ronaldo has been an example of dedication, work, responsibility, talent and improvement.
'He has also become the top scorer in the history of Real Madrid with 451 goals in 438 games. In total 16 titles, including 4 European Cups, 3 of them consecutive and 4 in the last 5 seasons. On an individual basis, with the Real Madrid jersey he has won 4 Gold Balls, 2 The Best, and 3 Gold Boots, among many other awards.
'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.'