Yoweri Museveni, the president, won re-election by a large majority on Saturday, officials said, to extend his two decades in power by another five years.
Uganda's first multi-party polls for a quarter of a century were being closely watched in the West as a test of African democracy and for the signal it might send to others in the region who also enjoy lengthy stays in power.
Final results gave the former guerrilla leader 59% of votes compared with 37% for his top challenger, Besigye of the Forum for Democratic Change (FDC).
Turn-out was 69%, election authorities said.
Ofwono Opondo, spokesman for Museveni's ruling Movement party, told Reuters: "He has won very convincingly,"
"The president is going to lead Uganda with a comfortable margin."
In parts of the capital Kampala, Movement supporters blew whistles and hooted car horns as word of Museveni's win spread.
Outside the FDC offices in a southern suburb, a stand-off brewed between riot police and hundreds of Besigye supporters.
The FDC says there were multiple irregularities in the election andvoters were intimidated. It is considering challenging the results in court.
Sam Akaki, FDC spokesman, said: "This election was as free and fair as it would have been under Saddam or Hitler."
Before the results were announced Uganda's top policeman warned opposition supporters to stay clam but hundreds joined a noisy protest outside the FDC headquarters.
Chanting that the election had been stolen and flashing the party's V-sign, they were quickly joined by riot police who ejected them from the compound into the road outside.
One Besigye supporter, jobless Colonius Kojo, 35, said: "Twenty-years is enough. It is even excessive."
Major-General Kale Kayihura, the inspector-general of police, said polling had gone well, but in the worst of a few isolated incidents, an explosive device was thrown at a military police patrol vehicle, injuring three officers and a girl standing nearby.