Kaka: ciao Milan, hola Madrid
The 27-year-old international has agreed a six-year contract to become the first player to join Real since Florentino Perez returned to the presidency this month.
Reports said the transfer fee was around 68 million euros ($94.05 million) which would make the transfer the second biggest ever (see list below) after Zinedine Zidane joined Real from Juventus for around 73 million euros in 2001.
The player is on international duty with Brazil in his home country, but Real Madrid sent officials to Recife and Kaka successfully completed a medical earlier in the day.
Milan thanked Kaka for his contribution.
"AC Milan thanks the man Kaka and the champion Kaka for his decisive contributions to so many victories obtained in the last six years," the Serie A club said in a statement.
"His loss on the field, though serious, can be filled. It will, however, be very difficult to fill the void left by Kaka the man."
Most expensive transfers:
Zinedine Zidane: Juventus to Real Madrid in 2001 @ 76 million*
Kaka: AC Milan to Real Madrid in 2009 @ 65m
Luis Figo: Barcelona to Real Madrid in 2000 @ 58.5m
Hernan Crespo: Parma to Lazio in 2000 @ 53.6m
Gianluigi Buffon: Parma to Juventus in 2001 @ 49.2m
Robinho: Real Madrid to Manchester City in 2008 @ 49m
Christian Vieri: Lazio to Inter in 1999 @ 48.3m
Andrei Shevchenko: Milan to Chelsea @ 46.5m
Dimitar Berbatov: Tottenham to Manchester United @ 46.4m
Pavel Nedved: Lazio to Juventus @ 46.2m
* (in million euros)
A 'Real' target for ages
The official unveiling in Madrid is likely to take place at the end of the month, after the Confederations Cup in South Africa.
"We are working on building a good team, an important team, and this has only just begun," Perez told radio station Onda Cero.
Kaka has long been a target for Real Madrid since former president Ramon Calderon promised to sign him in his election campaign in 2006 but failed to deliver.
Calderon resigned in January paving the way for Perez to come back three years after he stood down and he was returned unopposed to the post.
Kaka completed a routine medical earlier on Monday in Recife
A second 'Galactico era' at the Bernabeu
Perez has promised to deliver a "spectacular sporting project" built around the world's greatest players, and local media have spoken of a 300 million euro war chest which will be used to finance a second 'Galactico era' at the Bernabeu.
Having lured the likes of Luis Figo, Zinedine Zidane and David Beckham to Real earlier in the decade, Perez's flagship first signing on his return was Kaka.
It was a declaration of intent and a dig at his predecessor.
He has also spoken of interest in Manchester United's Cristiano Ronaldo, Bayern Munich's Franck Ribery, Liverpool's Xabi Alonso and Valencia duo David Villa and David Silva.
New coach Manuel Pellegrini is the man tasked with blending these talents into a team capable of challenging treble-winners Barcelona.
Kaka will not face much competition in midfield which was one of Real's weakest areas last season as they lacked flair players capable of opening up sides in big games.
Kaka's arrival will also cheer up Real fans clamouring for a more entertaining brand of football, and who had often chanted "Where is Kaka?" at player presentations under Calderon over the last couple of years.
Still a determined winner
Kaka defies the model of a modern footballer and the Galactico tag will not entirely suit him after his move from AC Milan to Real Madrid.
The devoted Christian largely avoids celebrity parties and does not worry too much about his image, expressing himself on the pitch with his mesmeric skill and driving runs.
Concentrating on his technique helped the 27-year-old win the Ballon d'Or and FIFA world player award in 2007 after his 10 goals helped Milan to their seventh European Cup triumph.
Kaka, who joined the Rossoneri from Sao Paulo as a youngster in 2003, became synonymous with the club but cracks began to appear after they only finished fifth in Serie A in 2008 and limped in third this season.
Unlike most of his peers, he managed to turn down under-achieving Manchester City's mega offer in January but the might of Real has always appealed.
Milan acknowledged two years ago that his father had held talks with the Spanish side and the rumours of a future move have never gone away.
He said he would remain at the San Siro as long as they had the same goals as him but two recent developments changed the situation.
Florentino Perez's return as Real president fuelled expectations of a return to the glittering Galacticos era while the departure to Chelsea of Milan coach Carlo Ancelotti, a mentor for Kaka, hit the Brazilian hard.
"He made me become great. It was him that opened the doors of the world to me," Kaka said before compatriot Leonardo was named the new Milan boss last week.
Leaving Milan on good terms
Kaka said that he was leaving AC Milan for Real Madrid on good terms and he understood that financial worries had forced the Italian club to sell him.
"I'm not disappointed in my relationship with Milan," he told reporters in the Brazil team hotel in Recife at a news conference broadcast live on television.
"There has never been a (financial) crisis like this one, I understand perfectly the club's position and I'm very grateful to Milan and the president," added Kaka, who joined the Rossoneri in 2003.
"I've won everything that I wanted as a player and this is a new motivation for me," Kaka said.
"The club needed to make this sacrifice, and I understand this very well. I don't blame the club for this.
"Everything I've done for Milan has been by mutual agreement, from the moment I arrived until my departure today."
"I'm leaving by the front door."
He said he was sure he could help his new club, overshadowed this season by treble-winning Barcelona, become a major force in Spanish and European football again.
"I'm sure Real Madrid will build a competitive team which can start winning titles again as they have always done throughout the club's history," he said.
"I'm sure Real can become major competitors in Spain and in European football."
Kaka brushed off a suggestion that he could wear the coveted number five shirt previously worn by Zidane and said the Frenchman would be an example to him.
"I don't know what number, I'll take my time choosing it and I'll respect the numbers," he said.
"I'm grateful for the five (suggestion), but I think Zidane is Zidane. To avoid any type of comparison, I'm going to try and write my own history. But Zidane will serve as an example to me."