A judge ruled on Monday that Ugandan security forces could not detain presidential challenger Bobi Wine inside his home and rebuked authorities for holding the candidate under house arrest following a disputed election. Mr Wine, whose real name is Kyagulanyi Ssentamu, has been unable to leave his home since January 14, when the singer-turned-politician ran as the main challenger to President Yoweri Museveni. Ugandan authorities have said Mr Wine can only leave his home on the outskirts of the capital Kampala under military escort because they fear his presence in public could incite rioting. But the judge said in his ruling that Mr Wine’s home was not a proper detention facility. Authorities should criminally charge Mr Wine if he threatens public order, the judge said. The US embassy in a Twitter post said the judge’s ruling “underscores the role of an impartial judiciary,” and added that Washington “calls on security forces to honour the decision.” UN spokesman Stephane Dujarric said, “It’s very important that the security forces do show restraint and also obey … the order.” Mr Wine’s associates welcomed the courtroom victory, but it remains to be seen if authorities will respect the judge’s order in the East African country, where similar orders have often been ignored. Ugandan police told reporters on Monday that they would pull back from Mr Wine’s residence but continue to carry out surveillance in the area. Mr Wine said hours after the court’s decision that soldiers still surrounded his home, “blocking access to all.” “Perhaps (as always) waiting for Gen Museveni’s orders on the next course of action,” he tweeted. Mr Museveni won the election with 58 per cent of the vote while Mr Wine received 34 per cent, according to official results. Mr Wine insists he won and has said he can prove that the military was stuffing ballot boxes, casting ballots for people and chasing voters away from polling stations. Mr Wine has accused Mr Museveni of staging a “coup” in last week’s election and is urging his supporters to protest his loss through nonviolent means. But he suggested in a statement Friday he might not go to court to challenge the official results because of concerns a possible loss there would validate Mr Museveni’s win. He said he would announce a decision “in a few days.” Despite failing in his bid to unseat the current president, the 38-year-old Mr Wine has become as the country’s most powerful opposition figure. He is set to name the official leader of the opposition in the National Assembly after his National Unity Platform party won at least 56 seats, the most of any opposition group in the legislative body. That number could rise to 61 when final results are announced. Mr Museveni’s National Resistance Movement party has more than 300 seats, an absolute majority that allows it to move ahead with his agenda without negotiating with the opposition. Mr Museveni, 76, has dismissed allegations of vote-rigging, calling the election “the most cheating-free” since independence from Britain in 1962. Uganda’s election was marred by violence before polling day and experienced an internet shutdown that remained in force until four days after the election. Social media sites remain restricted. Uganda has never witnessed a peaceful transfer of power – one reason why even some within Mr Museveni’s party are urging him to preside over an orderly transition.