Milan have reached an agreement to re-sign the Brazil forward Kaká from Real Madrid.
The 31-year-old last week revealed he wanted to leave the Bernabéu after four years – having joined from Milan for a reported €70m (£56m) in 2009 – and the Rossoneri vice-president, Adriano Galliani, moved quickly to persuade the 2007 Ballon d'Or winner to return to Serie A.
A statement published on Milan's official website on Monday morning confirmed a two-year contract was in place for Kaká, who was preparing to fly to Italy at midday after Madrid sanctioned his departure.
In a surprise move given the hefty fee paid for his services in 2009, it is understood the Spanish club have allowed the forward to leave on a free transfer, after talks between Galliani, the Real president, Florentino Pérez, and the player lasted until the early hours of Monday morning.
Kaká was an increasingly isolated figure during the three-year tenure of José Mourinho and Sunday's signing of the Wales winger Gareth Bale from Tottenham Hotspur for a world-record €100m fee would have pushed the Brazilian further down the pecking order.
The Milan statement continued: "Last night after 2000 CET, thanks to the traditionally good relationship between the two clubs, Real Madrid and Milan reached and formalised an agreement for the transfer of Ricardo Kaká into Rossonero colours. And overnight, a little before 0300 CET in the morning, an agreement was reached with the world-class Brazilian."
After leaving São Paulo as a teenager in 2003, Kaká won the Champions League and one scudetto during his six years in Milan – also landing the prestigious Ballon d'Or award in 2007 – and lifted the Primera Division trophy, the Copa del Rey and the Spanish Super Cup with Real.
But, speaking after scoring twice for Madrid in Thursday's 4-0 win over Deportivo La Coruña in the Trofeo Teresa Herrera, Kaká said in AS: "I want to go. I think now is the right time for me and for the club to leave amicably. I've spoken with [Madrid coach Carlo] Ancelotti and with the club – they all know.
"My father is talking now with the club to try to resolve this situation. Things are now difficult for me in the team and the club know what I want. It's my obligation to work hard and continue training, but my father is already working to see if something comes up. I think that it's best for me and for the club."
Kaká has also scored 29 goals in 87 appearances for Brazil and has represented the Seleção at three World Cups.