KABUL -- Accusations of fraud and misconduct, more than scores of Taliban attacks, threatened to overwhelm the results of Saturday's vote for the next president of Afghanistan, denying the winner legitimacy and frustrating efforts to restart peace talks to end 18 years of war.
When polls closed Saturday, Afghanistan's Interior Minister Massoud Andarabi said there had been 68 Taliban attacks across the country, most of them rockets fired from distant outposts. At least five people were killed, including one police, and scores more were injured.
A surge in violence in the run-up to the elections, which following the collapse of U.S.-Taliban talks to end America's longest war, had already rattled Afghanistan in recent weeks. Yet on Saturday, for those who went to vote it was the process itself that drew the greatest criticism, threatening the country's fragile battle against chaos.
Many Afghans found incomplete voters' lists, unworkable biometric identification systems aimed at curbing fraud, and in some cases hostile election workers.
Ruhollah Nawroz, a representative of the Independent Complaints Commission tasked with monitoring the process, said the problems were countrywide. Whether the problems were the fault of the government or the Independent Election Commission, Nawroz said Afghans will have trouble seeing the vote as free and fair.
Nawroz said he arrived at a polling centre in the Taimani neighbourhood of Kabul, the capital, at 6 a.m. and "hour by hour I was facing problems."
Polls opened at 7 a.m. local time and closed at 5 p.m. after the Independent Election Commission (IEC) extended polling by one hour.
Preliminary results won't be out until Oct. 17, with a final vote count on Nov. 7. If no candidate wins 51 per cent of the vote, a second round will be held between the two leading candidates.
Voter Hajji Faqir Bohman, speaking on behalf of disgruntled voters at the Taimani polling centre, said polling was so disorganized and flawed that even if his candidate wins, "I will never believe that it was a fair election."
The leading contenders are incumbent President Ashraf Ghani and his partner in the 5-year-old unity government, Abdullah Abdullah, who already alleges power abuse by his opponent. Cameras crowded both men as they cast their vote earlier in Kabul, with Ghani telling voters they too had a responsibility to call out instances of fraud.
A young woman, Shabnam Rezayee, was attacked by an election worker after insisting on seeing the voter's list when she was told her name was not on the list. Rezayee said the worker hurled abuses at her, directing her insults at her ethnicity. She then punched and scratched her.
When it ended and the attacker left, Rezayee found her name on the list and voted. "I am very strong," she said.
In Kabul, turnout was sporadic and in the morning hours it was rare to see a crowded polling centre. Afghans who had patiently lined up before voting centres were opened, in some locations found that election officials had yet to arrive by opening time.
Imam Baksh, a security guard, said he wasn't worried about his safety as he stood waiting to mark his ballot, wondering whom he would vote for. "All of them have been so disappointing for our country," he said.
The government's push to hold the vote was in itself controversial. In an interview with The Associated Press last week, former Afghan president Hamid Karzai, who still wields heavy influence, warned that the vote could be destabilizing for the country at a time of deep political uncertainty and hinder restarting the peace process with the Taliban.
But in an interview with The Associated Press on Saturday, Afghanistan National Security Adviser Hamdullah Mohib said he believed that nothing would be acceptable to the Taliban except a complete return to power.
"The elections were a way for us to show, for the people of Afghanistan to show, we are committed to democracy and self-determination and that is how we want to see Afghanistan ruled and that was the most important message and I think that was delivered."
On Saturday, a polling station at a mosque in southern Kandahar was attacked injuring 15 people, including a police officer and several election officials, along with voters. Three were in critical condition, officials said.
In northern Kunduz, where Taliban have previously threatened the city -- even briefly taking control of some areas -- insurgents fired mortar rounds into the municipality and attacked Afghan security forces on its outskirts, said Ghulam Rabani Rabani, a council member for the province. At least two people were killed. In dozens of other places across the country Taliban fired rockets and mortars to frighten people away from voting.
Tens of thousands of police, intelligence officials and Afghan National Army personnel were deployed throughout the country to protect the 4,942 election centres. Authorities said 431 polling stayed closed because it was impossible to guarantee their security since they were either in areas under Taliban control or where insurgents could threaten nearby villages.
At one polling station in Kabul's well-to-do Shahr-e-Now neighbourhood, election workers struggled with biometric machines as well as finding names on voters' lists.
Ahmad Shah, 32, cast his vote, but said the election worker forgot to ink his finger -- which is mandatory to prevent multiple voting by the same person.
"What sort of system is this?" he asked, frustrated that he had risked his safety to vote and expressed fear that fraud will mar the election results. "It's a mess."
Still, 63-year old Ahmad Khan urged people to vote.
"It is the only way to show the Taliban we are not afraid of them," he said, though he too worried at the apparent glitches in the process.
In the capital Kabul, traffic was light, with police and the army scattered throughout the city, stopping cars and looking for anything out of the ordinary. Larger vehicles were not being allowed into the capital on Saturday, which is normally a working day but for the elections was declared a holiday.
Campaigning for Saturday's elections was subdued and went into high gear barely two weeks ahead of the polls as most of the 18 presidential candidates expected a peace deal between the United States and the Taliban to delay the vote. But on Sept. 7, President Donald Trump declared a deal that had seemed imminent "dead" after violent attacks in Kabul killed 12 people, including two U.S.-led coalition soldiers, one of whom was American.
While many of the presidential candidates withdrew from the election, none formally did so, leaving all 18 candidates on the ballot.
Elections in Afghanistan are notoriously flawed and in the last presidential polls in 2014, allegations of widespread corruption were so massive that the U.S. intervened to prevent violence. No winner was declared and the U.S. cobbled together the unity government in which Ghani and Abdullah shared equal power -- Ghani as president and Abdullah as chief executive, a newly created position.