Ugandans have been voting in a presidential election tainted by widespread violence that some fear could escalate as security forces try to stop supporters of leading opposition challenger Bobi Wine from monitoring polling stations.

Long queues of voters snaked into the distance in the capital Kampala, but there were delays in the delivery of polling materials in some places, including where Mr Wine voted, and internet access was cut off.

After he arrived to the cheers of a crowd and cast his ballot, he made the sign of the cross, then raised his fist and smiled.

"Everybody was scared, they thought I would not cast my vote. Here I am coming from the polling station," he told local broadcaster NTV Uganda.

"I want to assure Ugandans that we can and indeed will win. Whether or not (the electoral commission chief) declares that, that is his business."

Results are expected within 48 hours after polls closed.

More than 17 million people are registered voters in this east African country of 45 million people. A candidate must win more than 50% to avoid a runoff vote.

Long-time President Yoweri Museveni, an authoritarian who has wielded power since 1986, seeks a sixth term against a strong challenge from Mr Wine, a popular young singer-turned-opposition legislator. Nine other challengers are also trying to unseat Mr Museveni.

After voting, the president was asked if he would accept the election's outcome and said "of course" but quickly added: "If there are no mistakes."

Mr Wine, whose real name is Kyagulanyi Ssentamu, has seen many associates jailed or go into hiding as security forces cracked down on opposition supporters they fear could mount a street uprising leading to regime change. He insists he is running a non-violent campaign.

Mr Wine, of the National Unity Platform party, has said he does not believe the election was free and fair. He has urged supporters to linger near polling stations to protect their votes, but the electoral commission, which the opposition sees as weak, has said voters must return home after casting ballots.

Internet access was cut on Wednesday night. "No matter what they do, the world is watching," Mr Wine tweeted.

Problems were reported with some biometric machines to verify voters. "Our kit failed to start because mismatching passwords," said Derrick Lutakoma, the presiding officer at one polling station.

The Herald:

"This election has already been rigged," another opposition candidate, Patrick Oboi Amuriat, told NTV as polls opened, adding: "We will not accept the outcome of this election."

The government's decision this week to shut down access to social media, in retaliation over Facebook's removal of Museveni-linked Ugandan accounts accused of inauthentic behaviour, was meant "to limit the eyes on the election and, therefore, hide something", said Crispin Kaheru, an independent election observer.

Support for Mr Museveni, 76, has traditionally been concentrated in rural areas where many credit him with restoring a sense of peace and security that was lost during the regimes of dictators including Idi Amin.

Security forces have deployed heavily in the area that encompasses Kampala, where the opposition has strong support partly because of rampant unemployment even among college graduates.

At least 54 people were killed in Uganda in November as security forces put down riots provoked by the arrest of Mr Wine for allegedly violating campaign regulations aimed at preventing the spread of coronavirus.