MILAN - Carlo Ancelotti has agreed to leave AC Milan but would not confirm on Sunday that he will be taking over as Chelsea coach. Milan's Brazilian sporting director Leonardo will replace Ancelotti as coach at the San Siro. Ancelotti's contract was due to run out in 2010 but speculation has been rife for months that he is heading to Premier League Chelsea. "In agreement with the club, we have decided to bring forward the expiry of my contract. This beautiful adventure at Milan is over," he told Sky after his side sealed the third Champions League spot on the final day of the Serie A season. "I can't say anything else official. I have not made any agreement with any other club." However, when he was told "good luck" in English, he replied: "This I won't understand until I arrive." Leonardo, a former Milan and Brazil player who became sporting director last year, has no managerial experience and the 39-year-old has not completed all his coaching badges. "It will be Leonardo. Tomorrow he will be presented at 12," club chief executive Adriano Galliani told Rai television when asked about the new coach. No details were given on how long Leonardo's contract would be or whether anyone else would be brought in alongside him. Other possible candidates for the job had included former Milan players Marco van Basten and Frank Rijkaard, both free after leaving Ajax and Barcelona, and highly rated Cagliari coach Massimiliano Allegri. However, Leonardo's odds plummeted recently when club owner Silvio Berlusconi said he wanted an emerging coach to take over. Galliani, who said he hoped Ancelotti could one day return to Milan, added that he had not talked with anyone else and the choice was always between the existing coach or Leonardo. LONGEST SERVING Ancelotti was Serie A's longest serving manager. he was appointed in 2001 and led the Rossoneri to Champions League glory in 2003 and 2007. However, his return of only one Serie A title in 2004 and Milan's failure to reach the Champions League last season meant the club were torn about offering him a new deal. Chelsea, whose interim coach Guus Hiddink left after their FA Cup final win on Saturday, have long been linked with him. The 49-year-old said he had turned the London club down last year and had denied he was leaving on several occasions in recent weeks. Reports had said Ancelotti would try to bring Milan playmaker Kaka to Chelsea but the coach joked on Sunday that the only player he wanted to take away with him was Paolo Maldini, who retired from football after Sunday's 2-0 win at Fiorentina. Kaka, who arrived at Milan as a raw youngster in 2003, paid paid tribute to Ancelotti. "He made me become great. It was him that opened the doors of the world to me," the Brazilian told reporters.