Uganda's High Court has ordered security forces to end their confinement of presidential election runner-up Bobi Wine.
Wine, whose real name is Robert Kyagulani, has been under effective house arrest at his home outside the capital, Kampala, since he returned from voting in the presidential election on 14 January.
Heavily armed soldiers and police officers surrounding the property have blocked members of Wine's household, including his wife, Barbie, from leaving their compound.
Last week the US ambassador to Uganda was also prevented from visiting the popstar-turned-politician, who won 35 percent of the vote according to official figures.
'Continued confinement unlawful'
Sitting at the court's Civil Division in Kampala, Justice Michael Elubu ruled in favour of a petition lodged by Wine's lawyers asking for his release.
"The continued indefinite restriction and confinement of the applicant to his home is unlawful and his right to liberty has been infringed," Elubu said.
"Having found that the restrictions are unlawful it is hereby ordered that they are lifted."
The Ugandan government had argued that the restrictions on Wine's movements were for his own protection and intended to prevent protests against the election result, which Wine claims was rigged in favour of President Yoweri Museveni.
Security forces are yet to vacate the area around Wine's home according to Abdu Hakim, an aide to Wine.
Ugandan security forces have in the past disregarded court orders calling on them to release individuals or have immediately re-arrested people freed by the courts.