The 28-year-old Brazilian is set to put pen to paper on a three-year deal at the San Siro subject to passing a medical on Wednesday.

Barca confirmed in a statement on their website that the initial transfer fee was 21 million euros, a figure which could rise by up to four million euros.

The statement read: "The principle of agreement finally established a transfer fee of 21 million euros, plus four million more in the form of performance-related bonuses depending on AC Milan's qualification, in future years, for the Champions League.

"(Barcelona) sporting director, Txiki Beguiristain, announced that this agreement in principle was reached thanks to the player renouncing his right to 15% of the fee."

The projected 25 million euro fee is around 10 million euros less than was reportedly being offered by English Premier League side Manchester City, who were Milan's only rivals for the signature of the two-time World Player of the Year.

The agreement followed a day of talks between Barca president Joan Laporta and Milan vice-president Adriano Galliani in the Catalan capital.

Ronaldinho reportedly travelled to Milan on Tuesday evening, and the Italian club confirmed the the deal now hinged only on the Brazil international successfully completing a medical.

"AC Milan and FC Barcelona have reached a principle agreement for the transfer of Ronaldinho to the Rossoneri," read a short statement on www.acmilan.com.

"The player will be tomorrow in Milan to undergo the medical examinations and sign the contract that will bind to Milan until June 30, 2011."

Milan will hope Wednesday's medical passes without a hitch as they are thought to be determined to unveil Ronaldinho on the same day their squad begins pre-season training.

Milan coach Carlo Ancelotti earlier revealed he hoped the arrival of Ronaldinho would give his side a much-needed lift ahead of the new season.

"The important thing is to have champions and Ronaldinho without a doubt is one of them," said Ancelotti.

The arrival of Ronaldinho is a big boost for the Serie A giants, who have failed to make a major signing so far this summer.

The Rossoneri are aiming to bounce back from a disappointing campaign which saw them finish fifth in the Serie A standings and fail to qualify for Europe's elite club competition.

Milan will therefore compete in the less glamorous UEFA Cup next season.

"We begin with the desire to improve," admitted Ancelotti.

"To be out of the Champions League is a hard blow so we will do everything to return to the competition as soon as possible.

"Quality is our trademark and it will continue to be whether Ronaldinho arrives or not.

"Our aim is as usual to win while providing a good show. This is Milan."