AC Milan have reached an agreement with Barcelona to sign Brazilian playmaker Ronaldinho, the Italian side announced on Tuesday. "AC Milan and Barcelona have reached an agreement in principle over the transfer of Ronaldinho," the Rossoneri said in a statement on their website. "The player will be in Milan tomorrow to undergo a medical and sign a contract that will keep him at Milan until June 30 2011." Milan, who will play in the UEFA Cup next season, will pay 21 million euros for Barcelona to sign Ronaldinho, the Spanish side said. Barcelona could receive an additional four million euros, depending on Milan's qualification for the Champions League in the next few years. Ronaldinho's future has been the subject of conjecture after he became surplus to requirements at the Nou Camp. The 28-year-old was heavily linked with Manchester City, who were reportedly willing to pay a hefty transfer fee to acquire his services. However, the two-time world player of the year chose to join Milan in a bid to revive his career.