KABUL, Afghanistan (CNN) -- Afghanistan officials said 26 people across the country were killed in election day violence, although they hailed Thursday's vote as a success.
A woman dips her finger in ink to show she voted in Bamiyan, one of Afghanistan's more peaceful provinces.
Nearly 95 percent of the more than 6,000 polling stations across Afghanistan opened on Thursday, according to government and electoral officials.
Counting is under way but initial results are not expected for another 36 to 48 hours, while final results will not be certified until mid-September.
Officials extended voting until everyone waiting in line had a chance to cast their ballots.
"At some [polling stations] there is a very large line," said Azizullah Ludin of Afghanistan's Independent Electoral Commission. "We have to complete all these people that are coming here."
It is the nation's second presidential election since the 2001 fall of the Taliban.
Ludin said the decision to add more time to vote was because of a large turnout at some stations and technical issues that delayed voting for others.
There were no official details on voter turnout and it has been difficult to get an accurate count of how many Afghans voted in defiance of threats of violence from the Taliban.
CNN's Atia Abawi said election officials at one polling station in Kabul had already begun counting ballots after a low turnout when the order to extend voting reached them. Afghan voter turnout low as presidential election nears end »
When asked how many ballots had been counted, an election official said 1,000 -- which seemed high to the CNN crew that had been at the polling station all day. "We were there all day and we did not see 1,000 people," CNN's Kevin Flower said.
Election workers in central Bamiyan province immediately began reopening the polls after the order to extend voting.
"Election workers had put up security tape barriers and even tied down the flaps to their voting tents shortly after 4 p.m. local time," CNN's Ivan Watson reported from the province. "The security tape has been removed and voters are straggling in again."
Election observers from 30 groups -- both domestic and international -- said voting in Kabul province was fairly smooth, though a few reports surfaced of irregularities at various polling stations.
Afghans were electing a president from 40 hopefuls and 420 members of the provincial council in what was seen in the international community as a high-stakes test for the fledgling South Asian democracy.
The Taliban had vowed to disrupt the voting and the risk factor in some areas may have been too high for some Afghans to venture out to vote. Watch an election monitor in Kabul discuss what's being examined »
The government ordered a ban on media coverage of incidents of violence in an effort to "ensure the wide participation of the Afghan people" as 300,000 NATO and Afghan soldiers were out in force to safeguard voters.
The independent Pajhwok Afghan News, which had announced it would not heed the media ban, posted online reports of deadly attacks across Afghanistan. CNN has not confirmed those incidents.
Afghan security officials said voting day violence claimed the lives of 17 Afghan policemen and soldiers, and another nine civilians.
An American service member was killed in a mortar strike in eastern Afghanistan, the U.S. military said. It did not say where the attack took place.
Major fighting continued for a second day in the city of Baghlan, north of Kabul, security sources said. Rockets were fired at the town throughout the day, a day after heavy fighting that claimed the life of the city's police chief, the sources said. Afghans in Baghlan are afraid to leave their homes to cast their ballots, Afghan security officials said.
In the eastern city of Gardez, four rockets pounded the outskirts of the city, while a roadside bomb struck in another area, the local security chief said. There were no casualties from either incident.
But other parts of Afghanistan have been largely spared the daily drumbeat of car bombs, assassinations and whizzing rockets.
Enthusiasm filled the air as voters lined up to have their say. Pajhwok reported brisk turnout in western Herat province, which borders Iran. Khwaja Mahboob told Pajhwok that he voted for a woman for a provincial council seat because he believed women should have a stronger say in Afghanistan. Watch what ranks high among Afghan concerns »
In central Bamiyan province, where predominantly ethnic Hazaras suffered under Taliban rule, thousands of voters cast their ballots behind cardboard screens inside dust-caked tents.
Police struggled to hold back and search the crowd and at one point, people pushed through, breaking off one of the gates to the polling center.
After voting, one elderly man admitted he wasn't sure who he voted for. "Whoever God wants will be king," he said.
Many Afghans are illiterate and rely on symbols like light bulbs and books to identify their candidates on the ballot paper.
Organizers from Afghanistan's Independent Election Commission said 11 polling centers in Daikundi province were closed because of security concerns.
Some polling stations in eastern Kunar and Nuristan provinces did not open and others, including 100 in Ghor, opened without a security presence, according to Pajhwok.
Afghanistan observers and experts said a high turnout would help marginalize the Taliban which ruled Afghanistan from 1996 until the 2001 U.S.-led invasion.
Incumbent President Hamid Karzai, dressed in his traditional purple and green striped robe, cast his vote shortly after the polls opened and had his finger stained with ink that is supposed to last for two weeks, a measure intended to thwart fraud by preventing people from voting multiple times.
"I'm sure this will be for peace, for progress and for the well-being of the Afghan people," Karzai said.
But at some Kabul polling stations, the ink apparently was not potent enough, according to Damaso Magbual, an observer from the Asian Network for Free Elections.
At another station, a boy who successfully voted with a fraudulent registration card, admitted to being only 13, Magbual said.
Karzai's top rival was his former finance minister Abdullah Abdullah, who once served as a confidante of Ahmed Shah Massoud, the charismatic leader of the anti-Taliban Northern Alliance killed by al Qaeda. Who are the candidates? How does the voting work? Read here »
The other candidate who gathered steam in the campaign was former Finance Minister Ashraf Ghani, a Western-educated man who served as a World Bank analyst.
Karzai was named interim leader after the fall of the Taliban regime and won the 2004 election by a significant margin. His popularity, however, has waned in recent months as Afghanistan has been crippled by corruption and increasing bloodshed.
Both Abdullah and Ghani hailed anti-corruption measures and government transparency as centerpieces of their campaign platforms.
Women's votes were seen as crucial after an especially repressive period for women under the Taliban when they were stripped of rights. But in some polling stations Thursday, women voters were greatly outnumbered by men. What do Afghans want? See in photos here »
Habiba Surobi, the female governor of Bamiyan, said women who live in remote Afghan villages are still not aware of their rights. "This is something to be concerned about," she said, adding that it was the responsibility of Afghanistan's women leaders to ensure better awareness and education.
About 15 million of Afghanistan's 33 million people are registered to vote. Earlier, officials had estimated that number as 17 million.
CNN's Atia Abawi and Ivan Watson contributed to this report.
All About Afghanistan