Afghan elections: What is at stake in presidential vote
Afghans voted in run-off polls on 14 June to elect a president to succeed Hamid Karzai, who has governed Afghanistan since the 2001 fall of the Taliban but is constitutionally barred from seeking a third consecutive term. Results are due in July.
This should be the first time power in Afghanistan has been democratically transferred. But pitfalls lie ahead.
Nato combat troops are scheduled to withdraw later this year. The new president is likely to have to cope with more insurgent attacks and the possibility that the Taliban would seek to regain power.Who are the main contenders?
The top two candidates from the first round were former foreign minister Abdullah Abdullah and former finance minister Ashraf Ghani Ahmadzai.
The men won 45% and 31.5% respectively, with more than half of votes cast needed to win.
Abdullah Abdullah was Hamid Karzai's main challenger in 2009. Foreign minister in 2001-2006 and de facto opposition leader since 2009, he is of mixed Tajik and Pashtun heritage (the two main ethnic groups).
However, he is widely seen as a Tajik, owing to his past role in the Tajik-dominated Northern Alliance as well as his ties to its former leader Ahmad Shah Massoud, assassinated in 2001.
Ex-academic Ashraf Ghani Ahmadzai was finance minister in Hamid Karzai's government from 2004 to 2006.
He appeals to urban Pashtuns and technocrats, but would need the backing of Pashtuns in the south-west to do well. He may struggle to get Tajik votes.
Another former foreign minister Zalmai Rassoul and five others stood in the first round.Is security the main logistical problem?
Yes. The Taliban vowed to disrupt the vote and there were a string of attacks leading up to it. They also pose a longer-term challenge to the entire system of government.
The US and Afghan governments reached a deal to allow thousands of US soldiers to remain after Nato withdraws combat troops at the end of 2014 in order to train Afghan security forces, but Mr Karzai has refused to sign it and has demanded that the Americans meet certain conditions. The two candidates left in the race back the agreement.
Violence was comparatively rare in the early weeks of the campaign, but there were a number of high-profile attacks in the run-up to the 5 April first round, including one on the Independent Election Commission (IEC) on 25 March. Just days before the second round, Abdullah Abdullah survived a suicide bomb attack targeting his convoy in Kabul.
The security forces have provided candidates with armoured vehicles and guards, and pledge to ensure safety at all polling stations by election day.
About 65,000 international forces are also ensuring security.What are the main issues?
A final security agreement with the US is the most pressing issue. The winning candidate will make this his priority. All other issues, from trying to bring the Taliban to the negotiating table to fighting poverty, corruption and the drugs trade, depend on this.Was the election free and fair?
Concerns over the transparency of the election remain high and both candidates left in the race have voiced concern. The previous presidential election in 2009 was marred by allegations of massive ballot-stuffing and intimidation. Dr Abdullah withdrew from the run-off in protest, allowing Mr Karzai to win by default.
This time, provisional results were delayed because votes were being re-checked at thousands of polling stations where irregularities were reported.
Donor countries have made it clear that continuing aid depends on fair elections.
Some election monitoring bodies pulled their staff out of Afghanistan following an attack on one of Kabul's biggest hotels in March but others remained alongside local Afghan election monitors and staff.
After the first round, thousands of election workers were dismissed over fraud allegations. In Herat, 100,000 ballots were invalidated by the local electoral complaints commission but many were later allowed to stand after a recount.
They have also alleged that masses of extra voting cards are in circulation. Although the number of eligible voters is estimated to be around 12 million, some 20 million registered voting cards are in circulation throughout the country.What happens next?
Votes have been counted since ballots were cast in June, with preliminary results expected in early July.
Final results are due later in the month, meaning Afghanistan's transfer of power is not now expected to take place until August.
This will prolong the uncertainty as the deadline for Nato withdrawal approaches.
This explainer was compiled with the help of BBC Monitoring which reports and analyses news from TV, radio, web and print media around the world. For more reports from BBC Monitoring, click here. You can follow BBC Monitoring on Twitter and Facebook.