Polling stations in Afghanistan have closed after a heavy turnout for Saturday's presidential election.
The turnout was so high for the country's first democratic transfer of power that some polling stations ran out of ballots.
Security was tight across the nation because Taliban militants threatened to disrupt the vote, but the polling seemed to be relatively free of violence.
The special United Nations representative to Afghanistan, Jan Kubis, praised Afghan voters for the turnout "despite the threats and intimidations" they had received from insurgents.
U.S. President Barack Obama issued a statement congratulating the "millions" of Afghans who voted in what he called the "historic" elections. He also paid tribute to Americans who have "sacrificed so much" to make the vote possible. Mr. Obama said the election was critical to securing Afghanistan's democratic future as well as continued international support.
Three frontrunners were among eight presidential candidates: Ashraf Ghani, a former finance minister and World Bank official, former foreign minister Zalmai Rassoul, and Abdullah Abdullah, also a former foreign minister.
Some 450 provincial government seats were at stake as well.
President Hamid Karzai, who has been in power since the fall of the Taliban in 2001, was constitutionally barred from running for a third term.
Preliminary results are expected later this month, and a final tally is due May 14. A second round of voting will be needed if none of the eight candidates receives more than half the vote.
The lead-up to the election was fraught with violence. Taliban militants had threatened to kill anyone participating in the ballot and had already carried out a number of bomb and gun attacks.
Afghan officials say they deployed hundreds of thousands of security forces to protect the country's 12 million eligible voters.
Neighboring Pakistan closed all border crossings with Afghanistan and deployed additional troops in an attempt to help Afghanistan conduct the election peacefully. Pakistan said border security arrangements were stepped up in close coordination with Afghan security forces. Pakistan's government also said it will free 13 more Taliban prisoners in a bid to bolster talks aimed at ending an insurgency that has killed thousands of people in recent years.