Earlier this month, Ugandan lawmaker Robert Kyagulanyi Ssentamu was campaigning for an opposition parliamentary candidate in the northwestern town of Arua. President Yoweri Museveni was also in town, campaigning for a different candidate, when protesters hit his convoy with stones.

In the scuffle that followed, Ssentamu’s driver was shot dead. On Twitter, the opposition politician wrote, “Police has shot my driver dead thinking they’ve shot at me.” He included a photo of a man slouching in a car, covered in blood.

In Uganda, Ssentamu, 36, is better known by his stage name, Bobi Wine, or — as he sometimes calls himself — the Ghetto President. He is a pop star turned politician who rose to fame in part by criticizing the government through song. In one of his most popular tracks, called “Freedom,” the singer asks, “What is the purpose of the constitution, when the government disrespects the constitution?"

”See our leaders become misleaders, and our mentors become tormentors,” he sings. “Freedom fighters become dictators, they look 'pon the youth and say we’re destructors.”

His lyrics are an obvious criticism of Museveni, who has led Uganda since 1986. Those who oppose Museveni say his rule has become increasingly autocratic.

The country once banned anyone older than 75 from serving as head of state — but last year, parliament reversed that provision, abolishing age limits and clearing the way for Museveni to serve as president for life. The bill was so controversial that it led to brawls in parliament. Many see a social media tax passed this year as part of the government’s larger effort to crack down on those who disagree with it.

Ssentamu’s landslide win last year and his influence have not gone unnoticed by Museveni, who fears that the young, charismatic singer is a potential threat to the president’s hold on his office. Uganda’s overwhelmingly young population sees Ssentamu as an ally in the fight against corruption.

But the singer’s tweet about his driver was the last one he posted, because he was then accused of involvement in the stoning of the president’s convoy. He initially was arrested and charged with unlawfully possessing weapons and ammunition. Those charges were dropped this week, and instead he was charged with treason.

His jailing has sowed discontent in Uganda and neighboring Kenya, where protesters have taken to the streets to call for his release.

When Ssentamu appeared in court this week, he reportedly appeared confused and had trouble walking.

His lawyer told Reuters that his family believes his “ribs on the right side are crushed.”

“He was beaten with a metal bar,” said one of his attorneys, Robert Amsterdam. “He’s unable to stand.”

Another attorney, Erias Lukwago, told CNN that Ssentamu “could not stand because his leg had been injured.”

“He was being carried by soldiers at the military court where he has been arraigned when I saw him,” he said. “He complained of pain in his spine, and we could see he has really been beaten.”

The government called accusations that he had been assaulted “rubbish,” Reuters reported.

But members of the Uganda Human Rights Commission, which visited the lawmaker in prison, said in a statement that security forces “pounced on him, hit his head with an iron bar, indiscriminately beat and kicked him all over the body until he became unconscious,” the Associated Press reported.

The U.S. Embassy in Kampala said in a statement that it is “disturbed by reports of brutal treatment of Members of Parliament, journalists, and others at the hands of security forces.”

Ssentamu is due back in court Aug. 30. A number of other opposition lawmakers have also been arrested.

Protests over the arrests turned violent this week, with at least one person shot dead. Video footage from one protest this week shows soldiers beating Reuters photojournalist James Akena. The military later apologized, calling the troops' behavior “unprofessional.”

On social media, Ugandans called for the president to intervene and release Ssentamu from detention, using the hashtag #FreeBobiWine. A petition asking for his release has also circulated worldwide, earning signatures from musicians including Femi Kuti, Eric Clapton and Chris Martin.

Museveni responded to calls for Ssentamu to be freed, saying in a statement that he is unable to release the politician. “Let us therefore wait for the courts and see what they decide,” he said.