The politician, whose real name is Kyagulanyi Ssentamu, is charged with disobeying statutory authority.

Ugandan pop star and opposition figure Bobi Wine has been freed on bail after spending three nights in a maximum-security prison.

The politician, whose real name is Kyagulanyi Ssentamu, is charged with disobeying statutory authority. He faces trial over staging a street protest in July against a tax on social media.

Prosecutors opposed his bail application on Thursday. The singer appeared via video link from prison in an apparent move by authorities to prevent a public appearance.

Wine also faces treason charges for asking the youth to challenge the leadership of President Yoweri Museveni in the East African country and has hinted he may run for the presidency in 2021.

Police fired tear gas and rubber bullets at scores of demonstrators who took to the streets on Tuesday to protest the politician’s arrest.

The singer, who entered parliament in 2017 and has emerged as a leading critic of Museveni, has struck a chord with young Ugandans with his songs about social justice.

Authorities have repeatedly blocked him from performing publicly.

One of Wine’s songs contains the lyric “freedom fighters become dictators”, while others hint that Museveni has stayed in power for too long.

The 74-year-old leader has ruled Uganda since seizing power at the head of a rebel army in 1986. He intends to stand for re-election to a sixth term in office in 2021.