Women walk past campaign posters of Ugandan President Yoweri Museveni in Kampala on Saturday after he won a fifth term. (Carl De Souza/AFP/Getty Images)

Ugandan President Yoweri Museveni, one of the most prominent U.S. allies in East Africa, routed his opponents in the country’s presidential election, but Thursday’s vote was dogged by international criticism and concerns about the repeated detention of the main opposition leader.

Museveni, 71, has been in power for 30 years since taking control in an armed rebellion. His willingness to contribute troops to U.S.-backed peacekeeping missions, especially a regional effort to eradicate the Somalia-based Islamic extremist group al-Shabab, has earned him substantial support from the White House, even as his security forces have regularly cracked down on the political opposition.

In the past week, Kizza Besigye, his principal opponent for the presidency, has been detained four times. On Friday, security forces fired tear gas into the party headquarters of Besigye’s Forum for Democratic Change (FDC) and then stormed the premises. Besigye and two other FDC party officials were arrested before they could announce alternative election returns.

The candidate was later released, although security personnel prevented him from leaving his house on the outskirts of Kampala on Saturday or holding news conferences. Other members of the security forces ringed the house of another candidate, former prime minister Amama Mbabazi, who ran for the presidency as an independent.

Secretary of State John F. Kerry called Museveni on Friday to express concern over the detentions and to encourage him “to rein in the police and security forces,” according to a statement from the State Department.

But some Ugandans said they did not expect the United States or Museveni’s other Western supporters to question the election results, unless Uganda’s security forces turned to violence against the opposition. Because of Western powers’ close ties to Museveni’s government, “they really can’t say much. Their hands are tied,” said Ugandan political analyst Angelo Izama.

The United States contributes $750 million annually in aid, along with military training and support.

Museveni won with nearly 61 percent of Thursday’s vote, down from 68 percent in 2011. Besigye trailed this time with 35 percent. This is the fourth time Besigye, who used to be Museveni’s personal physician, has run against the president. He has never polled higher than 38 percent.

Even before the results were announced, the opposition disputed the count. FDC President Mugisha Muntu issued a statement calling on “all Ugandans and the international community to reject and condemn the fraud that has been committed and to expose it to the fullest extent possible.”

Opposition representatives walked out of the official tally center Friday in protest, and the FDC refused to send a representative to collect the official returns.

“There is nothing like vote rigging; we just have bad losers,” said Mike Sebalu, a top official in Museveni’s National Resistance Movement.

That has not stopped the rumors circulating on social networks. In one incident on election day, protesters in a Kampala neighborhood ripped open a box they alleged was filled with ballots pre-marked in favor of Museveni. Hours later, the ballot papers were still scattered outside the polling station.

On the evening of the vote, Besigye was arrested when he tried to storm a Kampala house he said was being used to run a vote-rigging operation. Officials said the house was being used by police.

Eduard Kukan, the head of a European Union observation mission, said the observers were aware of the vote-rigging accusations but had not verified any of the claims.

The polls were dogged by other problems, though, including the hours-late distribution of ballots in the capital city, Kampala, an opposition stronghold. Museveni draws his support primarily from rural areas of the country. Across the capital, the delays forced officials to keep polling centers open an additional three hours. And three dozen polling stations were opened Friday because voting materials did not arrive Thursday.

Former Nigerian president Olusegun Obasanjo, the head of a Commonwealth observer group, said in an interim assessment that election-day deficiencies, including delays in supplying ballots, “have seriously detracted from the fairness and credibility of the results of the elections.”

While noting that problems such as the late delivery of ballots might have caused problems, the E.U.’s Kukan “would not say that they distorted the overall result.”

The government also ordered telecommunications providers to shut off access to social media, including Facebook and Whatsapp — two popular forms of communication among younger Ugandans.

But Ugandans circumvented the attempted blackout by using virtual private networks to get online and criticize the electoral process.

Ahead of the final tally, soldiers and police were deployed across a tense Kampala, where public anger was fueled by suspicions that Museveni’s administration had tried to steal the election.

“We’re all hoping for calm, but there’s no peaceful transition by the look of things,” said Ali Mukasa, who works in a barbershop across the street from the FDC compound that police and military forces stormed Friday. The road in front of his shop is scarred from fires that protesters set in their efforts to block the movements of security personnel.

After Besigye’s arrest, police officers engaged in running skirmishes with opposition supporters, firing tear gas and rubber bullets at the protesters. The Ugandan Red Cross treated 12 people for injuries, including four who were taken to a nearby hospital.

Although all was quiet after the returns were announced, Mukasa said he was worried about more violence after nightfall.

“America needs to make an interference, or this country is doomed,” he said.

Read more:

Deaths of two black farmers prompt a racial reckoning in South Africa

U.N. reports new rape accusations against peacekeepers in Central African Republic

Nairobi freaks out as lions escape from national park

Today’s coverage from Post correspondents around the world