KAMPALA, Uganda — More than 30 people were killed in violent protests in Uganda this week, officials said Friday, as supporters of presidential candidate and pop star Bobi Wine clashed with security forces over his arrest, in some of the worst unrest in the East African country in a decade.

It was unclear who was responsible for the deaths. Most of the 37 dead suffered gunshot wounds and traumatic injuries, said Uganda police’s chief pathologist, Moses Byaruhanga.

Wine, who has emerged as the strongest challenger to Uganda’s longtime leader Yoweri Museveni in elections set for early next year, was released on bail Friday, his lawyer Nicholas Opiyo said.

Opiyo said Wine was arrested on a coronavirus violation. But, he said, “the actual reason really is that it is part of the broader attempt to stifle opposition campaigns.” He noted that Museveni was also holding political rallies without interference by police.

Opposition candidates have argued that if the government feared an escalation of coronavirus cases it should have delayed the presidential election.

Tensions have risen ahead of the Jan. 14 poll as Museveni, 76, who has been in power since 1986, seeks a sixth term. Last year, he was cleared to run again after the country’s top court upheld a decision to scrap the presidential age limit, which was previously set to 75.

Scores of Wine’s supporters were injured and at least 577 arrested in the protests that broke out across the country after police arrested Wine in Luuka, east of Kampala, on Wednesday. Wine, 38, has a strong following among Uganda’s youths and poor living in urban areas. He has often called on Museveni to resign.

“The increasing spate of violence so early in the campaign season does not bode well for the weeks to come before the elections,” said Oryem Nyeko, an Africa expert at Human Rights Watch. “The authorities can stem the slide toward further violence by ending the harassment of journalists and opposition candidates and their supporters, and the violent disruption of their campaign rallies.”

Another opposition candidate, Patrick Oboi Amuriat, of the Forum for Democratic Change party, was also arrested Thursday but released hours later.

Museveni said in a statement that Uganda was losing people to the coronavirus and warned he would not tolerate any violations of coronavirus-related measures during campaigns. As of Friday, Uganda had recorded more than 17,000 coronavirus cases and more than 150 deaths, according to Johns Hopkins University data.

It is the second time that Wine has been arrested this month. On Nov. 3, television footage showed him being pulled from his car by police shortly after he registered as a candidate.

Wine, whose real name is Robert Kyagulanyi, would probably go back on the campaign trail, Opiyo said. But he expressed concern for Wine’s safety.

“It is unlikely they might kill him, but he is in serious danger of being hurt, being shot or being injured,” Opiyo said.

In 2018, Wine sought medical treatment in the United States after he said he was tortured by Ugandan military while in custody following a scuffle at a political rally in which his driver was fatally shot.

Wroughton reported from Cape Town.