The Independent Election Commission said polls closed at 5:00 pm (1230 GMT) after a two-hour extension due to long lines of people.
About 9.6 million of the 34 million population were registered to vote for one of the 14 candidates. The two main candidates are the incumbent President Ashraf Ghani, and Chief Executive Abdullah Abdullah, Presstv Reported.
Observers from the Afghanistan Independent Human Rights Commission said the turnout appeared to be low, especially among women.
Polling stations collected the votes under the protection of 100,000 Afghan forces with air support from US forces. Five thousand centers were set up across the country, according to security officials.
Authorities banned trucks from entering the capital Kabul in an effort to stop would-be bombers targeting residents as they cast their votes.
The Taliban was not idle throughout. The militant group carried out bombings and mortar attacks at some polling stations. Two civilians have been killed and over two dozen have been injured in the attacks. The provinces of Kunduz, Nangarhar, Kabul, Bamiyan and Kandahar witnessed security incidents.
Polling centers in areas under the Taliban control were closed due to security concerns.
Mohiuddin, 55, who only gave one name, said, “I know there are security threats but bombs and attacks have become part of our everyday lives.”
“I am not afraid, we have to vote if we want to bring changes.”
Ziyarat Khan, a farmer in Nangarhar, said, “I came this early morning to cast my ballot. Unfortunately my name was not on the list.”
“The whole process is messy like the last time.”
Preliminary results are not expected until October 19. Candidates need more than 50 percent of the votes to be declared outright winner, or else the top two will head for a second round in November.
Ghani, having voted at a Kabul high school, said the most important issue was finding a leader with a mandate to bring peace to the war-torn country. “Our roadmap (for peace) is ready, I want the people to give us permission and legitimacy so that we pursue peace.”
Campaigning was hampered by violence from the first day, when Ghani's running mate was targeted in a bomb-and-gun attack that left at least 20 people dead.
The Saturday election was initially slated to take place in April, but it was twice delayed because election workers were ill-prepared, and Washington was leading a push to forge a deal with the Taliban.
The election, the fourth since the Taliban were toppled in 2001, is taking place after peace talks between the militant group and the White House collapsed earlier this month.
Since October 2018, the Taliban’s Qatar-based political bureau has been engaged in a diplomatic process with the US, but US President Donald Trump declared the talks “dead” on September 9, after the militant group carried out a bomb attack in the capital, where 12 people, including an American soldier, were killed.
The government had long been engaging the militant group to come to the negotiating table. The Taliban, however, consider the government illegitimate.
Kabul now says it will only consider holding talks with the Taliban after the election.