The president has ruled for 30 years but the vote is likely to be his toughest challenge yet, given the size and enthusiasm of crowds at opposition rallies and all sides accusing each other of stoking tensions and assembling vigilante groups.

On Monday, one person was killed after police fired bullets and tear gas at Besigye supporters, who hurled rocks and erected street barricades.

"He's not going to go peacefully," Besigye, 59, said in an interview at his farm in the outskirts of the capital, repeating an assertion that he believed Museveni would rig the vote.

"Our more likely path would be to revert to the people. It is their voices that are being stolen," he told Reuters. Besigye added that his supporters lacked weapons "so the people who would be causing the bloodshed are the regime officials".

Museveni, 71, has warned opponents to expect a tough response from security services if violence erupts.

"Whoever will try to bring violence, you will see what we shall do to him,” Museveni said at his final rally on Tuesday, according to the Daily Monitor newspaper.

Political analysts predict that Museveni, a staunch Western ally who came to power in the East African state in 1986, will win, but they say this election is different because opposition support appears to have grown significantly.

Besigye, who was Museveni's personal doctor in the early 1980s and is now challenging him for the fourth time, is popular in urban areas where youth unemployment is rife.

Another former Museveni ally-turned-challenger, ex-prime minister Amama Mbabazi, has also drawn large rallies and hopes to siphon away support from disaffected members of Museveni's party, the National Resistance Movement (NRM).

But Museveni's message of slow but steady progress appears to still resonate strongly among rural voters, and analysts say he has built a patronage system where much of Uganda's bureaucracy feels indebted to the president.

Badru Kiggundu, chairman of the electoral commission, told reporters he had received tip-offs that leading candidates were planning to form "youth brigades, vigilantes, militias", and he urged them to desist.

Rights groups have called on Museveni to disband his "Crime Preventers" program, made up of loose groups of citizens estimated to number tens of thousands who activists say have assaulted supporters of opposition candidates.

Besigye accuses the police of intimidation and says he has been arrested 44 times since the last election in 2011.

He has sharpened his rhetoric from previous races, alleging Museveni has done little to address rampant corruption, high joblessness and Uganda's ill-equipped schools and hospitals.

"It will be disastrous, the longer he stays," he said. "Every potential for a failed state exists in this country."