Ugandans have been voting for the first multi-party presidential and parliamentary elections for 25 years.
Voters use plastic bowls for privacy while filling in their ballot papers
Turn-out is reportedly high, except where voters fled outdoor polling stations because of heavy rains.
Some opposition supporters have complained that their names were missing from the electoral roll and they were not allowed to vote.
There are five presidential candidates, but the front-runners are President Yoweri Museveni and Kizza Besigye.
Dr Besigye has complained of intimidation and harassment after being arrested and jailed last year on charges of treason and rape.
Polling stations closed at 1700 local time (1400 GMT), although the long lines of people still in the queue at that time should be allowed to vote.
Counting starts at each polling station straight after voting ends, with results to be declared by Saturday.
Opinion polls suggest a close contest between Mr Museveni and Dr Besigye in the presidential race. A candidate needs more than 50% to win, or the two front-runners will contest a second round.
"It seems to be going rather well, with a high turn-out," EU chief observer Max van den Berg told Reuters news agency from the north-eastern Soroti district.
The main rivals are Kizza Besigye (l) and Yoweri Museveni (r)
However, he noted that voting started late in some polling stations due to the late arrival of polling materials.
A police spokesman said there had been no reports of significant violence, reports the AP news agency.
Security is heavy, with 12,000 army reserves deployed at nearly 20,000 polling stations.
Fears of violence are highest in the north, where some 1.5m people have fled their homes because of rebel attacks.
About 10.4m people were registered to vote. They were also choosing members of the 284-seat parliament.
As Dr Besigye arrived to vote in the western district of Rukungiri, he found some unsealed ballot boxes, sparking arguments with election officials.
Mr Museveni said he was confident of victory in the first round, as he cast his vote in Kirihura also in the west.
The president has accused Dr Besigye of links to rebel groups and has referred to his supporters as "terrorists".
Mr Museveni had been seen as leading a "new generation" of African leaders but was criticised for changing the constitution to let him contest these polls after being in power for 20 years.
However, he has been praised for raising living standards and improving security after years of misrule under Idi Amin and Milton Obote.
On the eve of the poll, he warned that voting was "not a joke".
"It is a matter of life and death. If you decide wrongly, you will bear the consequences," he said in a national address on state-run radio and television.
"I am voting for Museveni because his manifesto is the best, because of the history of how he has stabilised and brought peace to this country," James Muwanga, 32, told Reuters in Kampala.
But Olive Namtongo, 29, said she would vote for Dr Besigye's Forum for Democratic Change (FDC).
"The country needs change. He [Museveni] is running out of ideas," she said.
Satellite phones are being used to ensure permanent contact with outlying regions.
Dr Besigye used to be Mr Museveni's personal doctor but the pair fell out and were election rivals in 2001.
The BBC's Will Ross, in Kampala, says the rift between the two has grown so large they both say they have not exchanged a single word for over six years.