Ugandan pop star-turned-lawmaker Kyagulanyi Ssentamu, also known as Bobi Wine. Picture: AP/African News Agency (ANA)

Ugandan singer-turned-politician Robert Kyagulanyi has left Uganda for medical treatment in the United States following accusations he was tortured by security forces, his lawyer told AFP on Saturday.

The 36-year-old reggae star - better known as Bobi Wine - had spent Friday holed up in a government hospital after being re-arrested while trying to leave the country.

Kyagulanyi became an MP in 2017, firing up a youthful population and proving a thorn in the side of ageing President Yoweri Museveni.

He was charged with treason last week after protesters stoned Museveni's car during a by-election campaign. 

The lawmaker's arrest sparked violent protests and international condemnation over his alleged torture.

"He left last night at around 11.OO pm aboard KLM flight for Schipol (Amsterdam) onward to the United States," lawyer Nicholas Opiyo said.

"He was in the company of his wife, Barbie and brother Daks Sentamu."

Released on bail on Monday, Kyagulanyi was seized again by police on Thursday evening at Entebbe airport, outside the capital Kampala, his lawyers said.

He was taken to the government's Kiruddu General Hospital in Kampala, where, the MP's international lawyer Robert Amsterdam said he had locked himself in a room with his wife and refused access to army doctors.

"The doctor who oversaw Bobi's torture is part of the team trying to access him," Amsterdam said

Supporters say he had been badly beaten and tortured while in army custody, during and after his arrest in the northwestern town of Arua earlier this month, and required medical treatment abroad.

On Friday, Ugandan chief justice Bart Katureebe issued a public reminder that the constitution bans torture.

"Security forces, when you are arresting Ugandans, arrest them like human beings, not animals," he said.

Kyagulanyi, who chanted lyrics about poverty and social justice, has become a lightning rod for youthful opposition to the 74-year-old president.

Museveni, who has held power since 1986, is expected to seek another term in 2021 after constitutional changes were passed last year to scrape age limits.

In this context, the brash former slum-dweller channels the daily frustrations of many young Ugandans in a country led mostly by old men.

Wine's "age, his background and his story" make him a challenge unlike any Museveni has faced during his 32-year rule, said political analyst Rosebell Kagumire.

Many Ugandans nonetheless credit Museveni with delivering a degree of stability after he came to power at the head of a rebel army, he said. 

"Now the majority of Ugandans are young women, and they don't relate to Museveni's political message."

However, it is unclear what Kyagulanyi's political ambitions will be the next election, Kagumire said.

"He has not yet even said that he wants to stand for president but a lot of people expect that" he will.