Musicians including Coldplay star Chris Martin have condemned the "vicious" treatment suffered by a Ugandan pop star turned MP who was severely beaten while in custody.

Pressure is mounting on the government of Uganda to free Kyagulanyi Ssentamu, also known as Bobi Wine, who has emerged as an influential critic of long-serving president Yoweri Museveni after winning a parliamentary seat last year.

The deputy speaker of Uganda's parliament said Mr Ssentamu is in "a lot of pain" after being beaten while in custody.

A letter signed by international stars including Martin, Chrissie Hynde, Femi Kuti, Brian Eno and Angelique Kidjo stated: "We pledge to remain vigilant about his ongoing detention and to use our voices ... to raise awareness about his case".

The government denies allegations that it tortured Mr Ssentamu, and the military released a video of the 36-year-old opposition leader smiling during the visit by the deputy speaker, Jacob Oulanyah.

Mr Oulanyah said of the beating: "This should not have happened. It was not necessary. But it happened."

Despite being in pain, Mr Ssentamu was in a "humorous" mood during the visit, Mr Oulanyah told reporters.

Mr Ssentamu is expected to make an appearance in a military court on Thursday. He has not been seen in public since August 13, when he was campaigning in a by-election in the north-western town of Arua.

Mr 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 Mr Ssentamu and the candidate he backed, Kassiano Wadri.

Mr Ssentamu's driver was shot and killed, allegedly by security forces.

The pop star, who is charged with illegal possession of firearms, was arrested with four other opposition MPs, three of whom face treason charges. A fifth legislator, Francis Zaake, has been taken to hospital with injures allegedly sustained during detention.

Security forces in recent days have violently suppressed street protests by Ugandans demanding Mr Ssentamu's release. Scores of people were arrested in riots in Kampala on Monday, and video by local broadcasters showed men in military uniforms beating up people, including at least two journalists.

Although Kampala was calm on Wednesday, riots were reported in the eastern town of Jinja, on Lake Victoria. Hundreds of people have also attended a special Mass in Uganda's main Roman Catholic cathedral to pray for Mr Ssentamu's safety and that of other detained MPs.

Religious leaders have condemned the violence "in which lives are lost, people are barbarically arrested and tortured and property destroyed".

Candidates Mr Ssentamu has campaigned for have defeated both the ruling party and established opposition parties. Some of his followers have urged him to run for president.

"He is a constant thorn in the flesh of Museveni," said Rikki Stein, former manager for musician Fela Kuti, who said he met Mr Ssentamu a couple of weeks ago and also organised the open letter by musicians.

"Everybody responded literally immediately, horrified by what is taking place.

"We're hoping to make enough noise to get (Mr Ssentamu) out."

Mr Museveni, a US ally on regional security, took power by force in 1986 and has since been elected five times. Although he has campaigned on his record of establishing peace and stability, some worry that those gains are being eroded the longer he stays in power.

The 74-year-old 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. Mr Ssentamu publicly opposed that decision.