Security forces can no longer detain the singer-turned-politician in his own home. It remains to be seen whether the military will oblige by the court order.
A Ugandan judge ruled on Monday that the country's security forces may not continue to keep the presidential challenger Bobi Wine under de facto house arrest.
The 38-year-old singer-turned-politician who ran against President Yoweri Museveni in the recent presidential election has been barred from leaving his house without a military escort since January 14.
Justice Michael Elubu ruled in favor of Wine's lawyers who had requested his release: "The continued indefinite restriction and confinement of the applicant to his home is unlawful and his right to liberty has been infringed."
"Having found that the restrictions are unlawful it is hereby ordered that they are lifted," Elubu said.
The judge declared Wine's home was not a proper detention facility and said that authorities must bring criminal charges against him if he threatens public order.
Ugandan authorities had said Wine could only leave his Kampala residence with a military escort, fearing that his presence would incite riots.
The court's decision was welcomed by Wine's associates — however, Ugandan authorities have a history of ignoring similar court orders.
"The judge ordered that the state and its agencies should immediately vacate his property and his right to personal liberty should immediately be reinstated," lawyer George Musisi told Reuters.
According to the official results, Museveni won the election with 58% of the vote against Wine's 34%.
Wine rejected the result claiming that he in fact won and said he had evidence of the military stuffing ballot boxes and accused Museveni of staging a "coup."
The former rapper said on Friday that he may not challenge the results of the election in court because a loss there would confirm Museveni's win.
Museveni, who has been in power since 1986, denied the allegations of electoral fraud and called the poll "the most cheating-free" since the country's independence.
The country was rocked by violence in the run-up to the presidential election, leading observers to question the fairness of the results.