Afghanistan's presidential election closed amid relief that attacks by Taliban fighters were fewer than feared for a vote that will bring the first-ever democratic transfer of power in a country plagued by conflict for decades.
It will take six weeks for results to come in from across Afghanistan's rugged terrain and a final result to be declared in the race to succeed President Hamid Karzai.
This could be the beginning of a potentially dangerous period for Afghanistan.
It comes at a time when the war-ravaged country desperately needs a leader to stem rising violence as foreign troops prepare to leave.
One of the eight candidates will have to score over 50% of the vote to avoid a run-off with his nearest rival.
The Taliban threat to wreck the vote through bombings and assassination failed to materialise, and violent incidents were on a far smaller scale than feared.
Turnout was seven million out of 12 million eligible voters,or about 58%, according to preliminary estimates,election commission chief Ahmad Yousuf Nuristani told reporters.
That was well above the 4.5 million who voted at the last election in 2009 which was marred by widespread fraud.
The US could point to the advance of democracy in one of the world's most violent countries as a success as it prepares to withdraw the bulk of its troops this year.
It has spent $90bn (€65bn) on aid and security training since helping Afghan forces to topple a strict Islamist Taliban regime in 2001, but US support for Afghanistan's fight against the Taliban has faded.
When the last election was held, the Obama administration had viewed Afghanistan as the "good war" - unlike Iraq -ordering a 'surge' of over 60,000 additional soldiers to be deployed.
Yet as US troops get ready to go home, the Taliban threat and uncertainty over neighbour Pakistan's intentions leave the worry that Afghanistan could enter a fresh cycle of violence,and once again become a haven for groups like al-Qaeda.
The constitution barred Karzai from seeking another term.But, after 12 years in power, he is widely expected to retain influence through politicians loyal to him.
Former foreign ministers Abdullah Abdullah and Zalmay Rassoul, and former finance minister Ashraf Ghani were regarded as the favourites to succeed Karzai.
More than 350,000 Afghan troops were deployed, guarding against attacks on polling stations and voters. The capital,Kabul, was sealed off by rings of roadblocks and checkpoints.
In the city of Kandahar, cradle of the Taliban insurgency, the mood was tense. Vehicles were not allowed to move on the roads and checkpoints were set up at every intersection.
Raising questions about the legitimacy of the vote even before it began, the election commission announced that at least 10% of polling stations were expected to be shut due to security threats, and most foreign observers left Afghanistan in the wake of a deadly attack on a hotel in Kabul last month.
In some areas of the country voters complained that polling stations had run out of ballot papers.
An official at the Afghanistan Telecom Regulatory Authority said suspension came after an Election Complaints Commission (ECC) complaint saying around a million text messages had been sent after campaigning had officially closed.
But the ECC denied asking for text services to be suspended and called for them to be restarted.
Afghans voted for a successor to Mr Karzai, who has led the country since the 2001 fall of the Taliban, in an election seen as a major test of the troubled country's stability after a 13-year US-led military intervention.