Brazilian midfielder Kaka has completed a return to AC Milan on a two-year contract after the Serie A side agreed a deal with Real Madrid, the Italian club confirmed Monday.
"Done deal", Milan's managing director Adriano Galliani announced on the club's website, with Milan adding that discussions ran until "between 0230 and 0300 CET in the morning (on Monday)".
According to the Italian press, Real allowed the 31-year-old to return to his former club on a free transfer, having paid $85m to bring Kaka to Madrid in 2009.
The Brazilian was also said to have taken a significant pay cut to facilitate his move to the San Siro, accepting an annual salary of around $5m plus bonuses, a considerable reduction from the $13 a year he received in Madrid.
"I'm going home!", the player told journalists at a Madrid airport before boarding a flight to Milan, where he is expected to land shortly after Monday lunchtime.
"I'm very happy, the talks took a long time. I want to thank the fans and my teammates for their support," added Kaka.
Kaka's first spell at the Rossoneri, from 2003 to 2009, coincided with his rise to prominence that culminated in him winning the 2007 Ballon d'Or after leading Milan to the Champions League title that year.
Kaka, who has scored 29 goals in 87 appearances for his country, last week made a public plea to be able to leave the Spanish giants as he looks towards cementing a place in the Brazilian national side ahead of next year's World Cup.
Coach Massimiliano Allegri on Friday praised the Brazilian's attributes and said he had "faith" a deal could be struck for Kaka.
"Kaka would strengthen us. He's versatile, and his technical attributes would be a big plus to the team," said Allegri.
"We still have two and a half days till the end of the transfer window and the club is working on it. I have faith."
Milan's push to bolster their squad before Monday's transfer deadline comes days after they qualified for the group stages of the Champions League.