Lawyers for a pop singer turned politician and prominent critic of Uganda’s veteran ruler Yoweri Museveni claim he has been badly beaten up, following his arrest after the presidential convoy was pelted with stones.

Robert Kyagulanyi Ssentamu, known to fans as Bobi Wine, was charged in a military court on Thursday with unlawful possession of firearms and ammunition. He had been arrested in the north-western town of Arua on Tuesday, after clashes broke out on Monday during campaigning for a byelection.

Kyagulanyi’s driver was shot dead in the violence. He later posted a graphic picture of the dead man slumped in the front of a car on Twitter, saying he had been killed by the police “thinking they’ve shot at me”.

“Mr Kyagulanyi’s health is in dire state,” Medard Segona, one of his lawyers, said. “He is in great pain. He can’t talk, he can’t walk, he sits with a lot of difficulty, his face is swollen and he cannot see,” Segona alleged.“He couldn’t speak when the charges were read to him and I believe he didn’t know what was going or understood the charges read to him.”

Many Ugandans expressed concern for Kyagulanyi’s safety after Uganda’s deputy prime minister told legislators he had been admitted to hospital in custody, without giving details.

The 36-year-old, who campaigns under the slogan “people power”, has made no secret of his ambition to challenge 74-year-old Museveni.

Rights groups say opposition politicians, journalists and civil society organisations face systematic harassment in Uganda, ruled by Museveni since 1986. Museveni has said in a statement that Kyagulanyi and others would be “punished according to the law”.

A group of four opposition MPs and 30 others who were arrested at the same time as Kyagulanyi appeared in a civilian court in Gulu on Thursday to be charged with treason. Segona, the lawyer for the defendants, told the magistrate some of the accused had been “badly beaten and tortured during the process and after arresting them” by soldiers.

In Kampala, the Ugandan capital, small groups of Kyagulanyi’s supporters took to the streets and burned tyres in protest but police quickly dispersed them.

The musician turned politician, who built a big following with a string of local hits as well as his Cadillac and sharp suits, had not been seen or heard from since his arrest. In a court session closed to reporters, he was remanded and will reappear on 23 August, the military said in a statement.

Museveni, a key US security ally, has been elected five times. The last vote in 2016 was marred by allegations of fraud. The ageing leader is now able to seek re-election in 2021 because parliament passed legislation last year removing a clause in the constitution that had prevented anyone over 75 from holding the presidency.

Kyagulanyi, who was elected to parliament last year, has emerged as a powerful voice with his calls for young people to “stand up” and take over from a “failed leadership”. He has compared himself to France’s Emmanuel Macron. On his Twitter feed Kyagulanyi says he is “one Ghetto child who has something to say through music”.

Many songs deal with social and political issues, calling for ordinary young people to act to improve their lives and their country.

International campaign groups said human rights have deteriorated significantly in recent years. Amnesty International criticised the imposition earlier this year of a levy on social media access that the government said would fund public services but was widely seen as aimed at curbing government criticism.