Ugandan Afrobeats musician-turned-politician Bobi Wine has been severely beaten by the security forces and is unable to walk or talk, his lawyers say.

The opposition MP has appeared at a military court in the northern town of Gulu, where he was charged with two counts of unlawful possession of firearms and one count of unlawful possession of ammunition, but not treason as had previously been reported.

He was arrested after a vehicle in President Yoweri Museveni's convoy was attacked on Monday in the town of Arua, ahead of Wednesday's fiercely contested by-election.

Wine's driver was later shot dead, in what the MP says was an attempt to kill him.

His ally Kassiano Wadri, who won the Arua poll, was earlier charged with treason, along with 31 others.

The authorities have not responded to the allegation that Wine was assaulted in custody.

The 36-year-old has long been an outspoken critic of Uganda's government.

"When our leaders have become misleaders and mentors have become tormentors. When freedom of expression becomes the target of oppression, opposition becomes our position."

The lyrics are from a song titled Situka, which means "Rise up" in Luganda, sung by Wine ahead of the 2016 general elections.

The Afrobeats artist was using the song to exhort Ugandans to play an active role in fighting corruption and injustice in their country.

At the time many of the country's famous musicians backed President Yoweri Museveni's re-election but Wine however refused to hop on the bandwagon.

It was then that some suspected that Wine wanted to play an active role in politics.

Who is Bobi Wine?
The Afrobeats star, who began his music career in the early 2000s, has always described his craft as "edutainment" - entertainment that educates. One of his earliest hits, Kadingo, is a song about personal hygiene.

Wine, whose official name is Robert Kyagulanyi Ssentamu, was elected to parliament as an independent in a by-election last year in Kyadondo East, central Uganda.

He beat candidates from the ruling National Resistance Movement (NRM) and the main opposition Democratic Change (FDC).

The self-declared "ghetto president" told the BBC after his win that he represented a new generation: "I am going to stand up for issues. I'm here to give young people confidence," he said.

The moniker came about after he continued recording music, despite his fame, in his poor neighbourhood in Kamwokya, in central Kampala where he grew up, the BBC's Patience Atuhaire says.

Social media tax
In July, Wine locked hands with activists and marched on the streets of the capital, Kampala, to protest against a social media tax introduced ostensibly to boost state revenue and to end what Mr Museveni called "gossip" on WhatsApp, Facebook and Twitter.

Critics, however, said the 200 Uganda shillings [$0.05, £0.04] daily tax was meant to suppress dissenting voices.

The government has since backtracked and said it will review the tax.

Wine was also a leading critic of the NRM's push to scrap the constitutional upper age limit, set at 75, for presidential candidates.

He was among several opposition lawmakers who frustrated numerous debates in parliament to resist the change.

At one point scuffles broke out in parliament during the debate.

The opposition was however overwhelmed by lawmakers from the ruling party who managed to pass the bill that has since been signed into law, and will allow Mr Museveni, 74, who took power in 1986, to run for a sixth term in 2021.

"He lost touch with the people [and] the values that he stood for. He came preaching fundamental change but right now he stands for no change," Wine told the BBC.

Youth support
Political analyst Nicholas Sengoba says Wednesday's by-election in the north-western town of Arua, which was won by a candidate backed by Wine, was "do or die for Museveni".

"His party would be wondering if this is now a trend. Bobi Wine has now beaten Museveni and Besigye four times," in local elections.

"Bobi has rallied his support to the slogan 'people power', and he aims to galvanise and organise it into a movement," he adds.

Political analyst Robert Kirunda says Wines's appeal comes from a "leadership vacuum" in Uganda.

"There are many young people who are not interested in the historical struggle that brought NRM to power, nor with the radical defiance of the main opposition, [Kizza Besigye's FDC]. Most of them want jobs and they feel the economy is not working for them."

Mr Kirunda says that Wine is being "oversold". "He's a fantastic mobiliser but he is yet to experience the power of the state machinery like Besigye has".

The long-time Uganda opposition leader has endured arrests, physical assault and detention. "Bobi is yet to experience this," Mr Kirunda says.

"I also think there's a fundamental difference between leadership and drawing a crowd. I have, for example, not seen him bring a bill to parliament," he adds.

According to arts journalist and blogger Moses Serugo, Bobi Wine's oratory skills and his alignment to people who live in the "ghetto", mostly the youth, have allowed him to appeal to them.

He says Wine's career as an actor, not a singer, is what has helped him become such an influential politician in Uganda.