Voter turnout appeared stronger in the north than the south, where insurgents had launched rockets and suicide blasts that caused several polling stations to close, the Associated Press reported.
Election officials held other polling sites open for an extra hour, until 5 p.m. local time, to allow more Afghans to vote.
Taliban militants had pledged to disrupt the vote and punish those who cast ballots. Voters are marked with indelible ink on one finger to avoid fraud.
Security companies in the capital reported at least five blasts, while Kabul police exchanged fire with a group of armed men for about an hour, according to the AP.
President Hamid Karzai, who is seeking a second five-year term, voted at a high school in Kabul, holding up his ink-stained finger for the cameras.
"I request that the Afghan people come out and vote, so through their ballot Afghanistan will be more secure, more peaceful," he said. "Vote. No violence."
Karzai is favored to win in the election, though official results may not be known for days. In 2004, he won with 55.4 percent of the vote.
His closest challenger is former foreign minister Abdullah Abdullah. If no candidate receives a majority of the vote, a runoff will likely be scheduled for October.
Gilles Dorronsoro, a visiting scholar at the Carnegie Endowment of International Peace, spent the past few weeks leading up to the elections traveling around Afghanistan and finding that, across the board, people were most concerned about overall security of the country.
He said residents of the southern city of Kandahar, for example, reported that Taliban were coming from the neighboring Helmand province, causing their security situation to deteriorate. People in the northern city of Kunduz expressed the same security concerns, he said.
The Taliban seemed to be using intimidation tactics, such as stopping people on the roads outside of cities, Dorronsoro said.
"When I came from Kabul yesterday (Sunday), the Taliban had blocked the road. They put a truck on fire. So we had to wait for two or three hours on the road before the fire stopped," he said.
Leading up to the vote, militants carried out a series of assaults around the country, including a suicide blast in Kabul that killed at least 10 people. In northern Baghlan province, insurgent attacks closed 14 polling sites, and the police chief of Old Baghlan city and several police were killed, said Abdul Malik, the provincial election director, reported the AP.
But the United Nations said it was "cautiously optimistic" about the size of the turnout.
"Despite some initial attacks in the early morning, voters have demonstrated their determination to participate," said Aleem Siddique, spokesman for the U.N. mission in Kabul, quoted Reuters. "As the afternoon has proceeded, we have seen less attacks, we have seen the situation settle."
View an election slide show here.
---- Compiled from wire reports and other media sources