Results are expected on October 19, if neither man wins over half the votes, a runoff would take place
Despite pulling off a safer presidential election than expected, Afghanistan looks headed for a prolonged period of political uncertainty, with the two front-runners claiming victory before ballots are tallied and signalling they would not accept defeat.
The situation echoes 2014, when candidates Ashraf Ghani and Abdullah Abdullah alleged massive fraud by each other, forcing the United States to broker an awkward power-sharing arrangement that made Ghani president. Both men, front-runners again, say they would not accept a similar arrangement this time.
At the same time, Taliban insurgents rule more of the country than at any time since they were ousted from power nearly two decades ago, and have refused to accept the legitimacy of what they call a puppet US-backed government.
The unity government between the two candidates holds power until the winner is selected and takes office.
Results are expected on October 19. If neither man wins over half the votes, a runoff would take place.
"There is serious risk of an extended political crisis and divisive battle over the outcome, while the Taliban remain effectively unified," said Colin Cookman, a program officer with the US Institute of Peace, who has analysed Afghan politics since 2008.
Petr Stepanek, ambassador of the Czech Republic to Afghanistan, said a second round of voting possibly would not be held until spring, prolonging the uncertainty.
"The election commission can say, 'the weather is bad' and postpone it for a couple of months," Stepanek said. "Then we will have a weak government. A lame duck."
About 4,500 complaints have been filed since the Sept. 28 election, providing possible ammunition for the loser to reject the results. The Independent Election Commission said on Sunday that some biometric verification machines were lost.
Turnout was an estimated 2.6 million votes, about one-quarter of eligible voters, following threats by the Taliban against voting stations.
Negotiations about withdrawing US troops in exchange for Taliban security guarantees broke down in September, although the two sides held exploratory talks in Islamabad last week.
The next step would be negotiations between the Taliban and Afghan government about a ceasefire and the Taliban's future role. The militant group has so far rejected any talks with the government.
Little to complain about
The Ghani camp has dismissed fears of a prolonged political stalemate.
This election included more checks and balances than ever to prevent fraud, leaving Abdullah little to complain about if he loses, said Daoud Sultanzoy, a senior Ghani campaign leader.
He said he believes Ghani dominated Afghanistan's cities and eroded Abdullah's support in northern areas, giving him a comfortable first-ballot win.
"The process is the most transparent we've ever used," Sultanzoy said. "Somebody has to put Abdullah in his place. Enough is enough."
Asked if Ghani would accept an Abdullah victory, Sultanzoy said that possibility was "far-fetched."
Abdullah is equally certain that his coalition of ethnic Hazaras, Tajiks, Uzbeks and some Pashtuns has made him a winner, said his spokesman, Mujib Rahman Rahimi.
However the Abdullah camp is concerned about numerous irregularities, such as improbably high turnouts in insecure areas. Abdullah would accept defeat if the election is clean and only biometrically verified votes are counted, Rahimi said, adding that he has confidence in the commission.
But Abdullah will not accept a tainted vote, he said.
"He commands the real power in Afghanistan," Rahimi said. "If he comes out 'no' to the result the country will collapse. We should not go that direction, that is our hope."
Diplomats, speaking anonymously because of the sensitivity of the situation, said the more confusion that overhangs the Afghan government, the easier it will be for the Taliban to fill the vacuum. Recent foreign visits by the Taliban may help legitimize the group, they say.
In Islamabad last week, Taliban members hugged Pakistan's foreign minister and exchanged gifts before the cameras. The Taliban - which calls itself the Islamic Emirate of Afghanistan - then raised issues that are the usual domain of government, such as the plight of Afghan refugees in Pakistan.
The visits are "normal political activities" planned long ago, and are no attempt to fill a leadership vacuum, said Taliban spokesman Zabihullah Mujahid.
He added that the political uncertainty in Kabul is of no concern, since the Taliban considers the election illegitimate.