AC Milan and Flamengo reached an agreement on Saturday for Ronaldinho's transfer to Brazil's 2009 champions, the Italian club's vice-president Adriano Galliani said.
"I believe Ronaldinho's chances of playing for Flamengo are at 99.9%," Galliani told reporters in Rio following a meeting with Flamengo president Patricia Amorim.
Ronaldinho was given permission by Milan to seek a move to a club back home after struggling to win a first team place with the Serie A leaders as he looks to enhance his hopes of a place in Brazil's 2014 World Cup team.
The gifted, 30-year-old former FIFA world player of the year, who shone at Barcelona in the mid-2000s, had looked more likely during the week to return to his first club Gremio.
However, Amorim said: "Flamengo and Milan have reached an agreement over a transfer... we need two or three days to agree (personal terms with Ronaldinho)."