WATCH: Ugandan pop star, government critic Bobi Wine free on bail

Ugandan pop star-turned-government critic Bobi Wine has been freed on bail.

The 36-year-old lawmaker, whose real name is Robert Kyagulanyi Ssentamu, has been in detention since August 14.

See video and pictures below

Ssentamu was released by a judge in the northern Ugandan town of Gulu on Monday. He was freed alongside others who are similarly charged with treason for their alleged roles in an incident in which the presidential motorcade was pelted with stones.

Ssentamu was on crutches as he entered the courtroom. An ambulance was on standby to transport him and others after winning bail.

Ssentamu was initially charged before a military court with illegal possession of firearms and ammunition. Those charges were later withdrawn.

* Sign up to News24's top Africa news in your inbox: SUBSCRIBE TO THE HELLO AFRICA NEWSLETTER

FOLLOW News24 Africa on Twitter and Facebook

Ssentamu's arrest came after he was campaigning on August 13 in an election to choose a lawmaker in the northwestern town of Arua.

Ugandan President Yoweri Museveni also was in Arua at the time, campaigning for a rival candidate who eventually lost.

While the president was departing, authorities said, his motorcade was pelted with stones by people associated with Ssentamu and the candidate he backed, Kassiano Wadri. Ssentamu's driver was shot and killed, allegedly by security forces.

Authorities have been under pressure to free Ssentamu, who is challenging the long rule of Museveni.

The jailing of Ssentamu has drawn street protests at home as well as outrage from top musicians around the world.

Ssentamu has alleged severe torture while in detention.

"These people should never have been tortured, should never have been terrorised," said Kizza Besigye, a four-time presidential contender who witnessed court proceedings on Monday.

At least two of Ssentamu's co-accused fainted during court proceedings, and one of them had required resuscitation, Besigye told reporters.

The government denies the allegations of torture.