NAIROBI — A Ugandan musician turned politician whose arrest sparked a worldwide social media protest has revealed the horrific details of the torture he says he suffered at the hands of the military last month.

Immediately after soldiers apprehended him, Bobi Wine wrote on Facebook from the US where he is receiving medical treatment, they began beating him mercilessly all over his head — and in at least one instance, he said they “pulled my manhood and squeezed my testicles while punching me with objects I couldn’t see.”

Wine, whose real name is Robert Kyagulanyi Ssentamu and is also known as "The Ghetto President," faces treason charges after being arrested by special forces soldiers on Aug. 13 for allegedly for obstructing the motorcade of Ugandan President Yoweri Museveni during a campaign rally in Arua, a small town in northwest Uganda near the border with the Democratic Republic of Congo. The scuffle reportedly resulted in state troops shooting and killing one of Wine’s drivers; he said after the incident that those bullets had been meant for him.

But it wasn’t until Wine, 36, was released 10 days later that the public became aware of allegations he had been beaten while he was in custody.

On Monday, Wine posted on Facebook from a hospital bed in the US, having arrived there on Saturday to share for the first time what he said were the gruesome details of his arrest and detainment by the Ugandan Special Forces Command unit.

Safely arrived in the US where I'll be receiving specialised treatment following the brutal torture at the hands of SFC soldiers. We thank the world for standing with us. I will soon tell you what exactly happened to me since 13th August and what is next. #peoplepower Power https://t.co/0IcA3wUAQd

He wrote that after hearing the news that his driver, Yasin Kawuma, had been shot dead by police on Aug. 13, Wine took cover in a nearby hotel room. He could hear soldiers close in on him, beating innocent hotel guests as they got closer, until he saw them break down his door with an iron bar.

“I put my hands up and just before my knees could reach the floor, the soldier who broke into the room used the same iron bar to hit me,” he said, which caused him to fall to the ground. “In no minute, all these guys were on me — each one looking for the best place to hurt,” he added.

He said he could not remember how many soldiers were in the room, but recalled that they beat, punched, and kicked him with their boots. “No part on my body was spared,” he said, as they pummeled him in the eyes, mouth, nose, elbows, and knees.

Wine said the soldiers eventually dragged him out of the hotel room and into the back of a vehicle, where the beatings continued.

Stringer / AFP / Getty Images

Protests in the Ugandan capital of Kampala following the arrest of Bobi Wine.

“They pulled my manhood and squeezed my testicles while punching me with objects I didn’t see,” he wrote. “They pulled off my shoes and took my wallet, phone and the money I had. As soon as the shoes were off, they started hitting my ankles with pistol butts.”

The soldiers used an object Wine said felt like pliers to yank on his ears. And when he yelled out in pain, he said the soldiers simply ordered him to stop making noise.

Eventually, Wine said, the soldiers took him to a military hospital, where he received several injections from doctors who repeatedly refused to tell him what they were putting into his body.

While still in the hospital, he was finally granted permission to see his family. Wine said he was also charged with another crime as well as obstructing the president’s motorcade — illegal possession of a firearm, although his attorneys argue that none were found anywhere near him the day of his arrest.

In Wine’s recollection, his treatment by military officials, from soldiers to medical staff, did not begin to improve until his Aug. 23 court date approached.

“It was clear they wanted me to appear in better shape at the next time of my court appearance and they did everything possible to achieve that,” he wrote.

Referring to one man at the military medical center, Wine said, “He told me it was in my interest to eat well, take in all the medicine and look better by [the] 23rd or else they would not allow the press to see me and I would be remanded again until I was presentable enough!”

Uganda’s Special Forces Command did not immediately respond to a BuzzFeed News request for comment.

Stringer / AFP / Getty Images

Bobi Wine in his military court appearance.

Wine showed up in court in the northern Ugandan town of Gulu on Aug. 23 looking emotionally broken, hardly able to speak, and struggling to walk, even with the use of a crutch. Protests took place around the world, from neighboring Kenya to London and Tokyo, once people got wind of the injuries he’d endured. He arrived in the US on Aug. 31.

Wine has always been a well-known figure in East Africa — initially for his catchy Afropop songs, and later for the progressive energy he brought to Uganda’s parliament when he was elected last year. But he drew even more attention when he joined local activists demonstrating against a tax on WhatsApp and other social media platforms.

One of Wine’s attorneys, Robert Amsterdam, told BuzzFeed News by phone from Toronto that his client’s appeal to the younger population helped him spread his case further than Uganda and to the rest of the world.

“I think he is really such an exemplar of what can be accomplished no matter what your circumstances are,” Amsterdam said. “I think that Bobi is much more than his somewhat limited role as an MP in Uganda.”

Some young politicians, like 26-year-old Adeke Anna Ebaju, have watched what’s happening to Wine and are feeling caught between fear and the need to rise to the occasion.

“When I read Bobi’s account of the torture my blood ran cold,” Ebaju, the National Female Youth MP, told BuzzFeed News in a WhatsApp message during a parliament meeting.

She added that seeing how badly he was treated was “symbolic and revealing about the narrow space that we are having in Uganda. The political space is narrowing. The tolerance of divergent views is dimming away.”

Jack Taylor / AFP / Getty Images

Yoweri Museveni

Museveni rose to power in 1986, and his 32 years as president have been marred by allegations of suppressing opposition parties and killing civilians. In January, the 73-year-old signed a law that eliminated the 75-year age limit for presidential candidates, allowing him to run for a sixth term in 2012. Wine was among the politicians who opposed the amendment.

But Ebaju refuses to give in to hopelessness.

“I am encouraged because many young people who have not considered the governance of their country as something important are actually now taking time to understand what is happening in their country,” she said.

“They are speaking out about their discontent, the oppression, the violence, the misuse of our army to harm civilians,” she added, referring to widespread allegations that the Ugandan military uses the hundreds of millions of dollars it receives from the US for specific counterterrorism purposes against its own people.

Tamerra Griffin is a reporter for BuzzFeed News and is based Nairobi, Kenya.