Diego Maradona can leave a psychiatric clinic where he was being held against his will for cocaine addiction treatment, a judge ruled on Monday.
Maradona's family forced him to enter the clinic on the outskirts of Buenos Aires in May after he was rushed to intensive care in April with a swollen heart and breathing problems.
The 43-year-old was making plans to continue his treatment in Cuba, which the former Argentine captain has made his second home in recent years.
"We'll be leaving as soon as possible," Alfredo Cahe, Maradona's personal doctor, told local radio.
Maradona was bloated and barely able to speak at the time of his admission into the hospital but has since slimmed down and appeared more lucid in a television interview last month.
His family had argued his addiction left him mentally unfit to make decisions about his treatment.
But Judge Norberto Garcia Vedia said on Monday that Maradona could continue treatment "at the clinic of his choice".
Maradona is regarded as one of the most gifted players in the history of soccer and led Argentina to victory at the 1986 World Cup finals.
He says he has been fighting drug addiction for much of the last 20 years.