There was no major violence against voters on Sunday, despite more than two dozen harassing attacks by the fighters across the troubled south and east in which 14 people died.
"We're building our country, we're making our parliament," Mohammed Twahir, 36, said after voting in the southern city of Kandahar, once a bastion of support for the Taliban.
"Before there was no democracy, now we have democracy. Democracy means freedom."
That enthusiasm was echoed by many other voters.
"I'm so happy, I couldn't sleep last night and was watching the clock to come out to vote," said Qari Salahuddin, 21, in the eastern city of Jalalabad soon after voting began.
Others were sceptical. One woman who gave her name as Simabol told Aljazeera: "Most candidates have exploited their political and material clout to be elected to the parliament.''
A policeman stands guard outside
a polling station in Kandahar
Aljazeera's correspondent in Afghanistan Yousif al-Shuli said thousands of Afghan and foreign troops were on the streets in the capital, Kabul.
There was an early scare in Kabul when two rockets hit a UN compound near an election centre shortly after polls opened, wounding an Afghan worker, Reuters reported.
Most of the fatalities occurred in violence near the Pakistani border, just before and during the UN-organised vote.
Rockets and mortars killed at least five civilians, two of them children, and a mine blast killed a French soldier. A Taliban fighter died attacking a polling station overnight and three more were killed in a clash in which two police officers died.
But the UN-Afghan election commission said voting in the first legislative elections since 1969 had been remarkably peaceful and the government hailed a victory over the insurgents.
"It went very well, beyond our expectations. After all their boasting, it's a big failure for the Taliban," said Interior Ministry spokesman Lutfullah Mashal.
A woman displays her voter
registration card in Mazar-i-Sharif
Voting was held at more than 6000 polling sites from the deserts of the south to the towering Hindu Kush mountains of the northeast, one of the most difficult logistical operations undertaken by international electoral workers.
About 12.5 million Afghans registered to vote for a lower house of parliament and provincial councils for which about 5800 candidates sought seats. Donkeys and camels transported voting materials to some remote districts.
Chief electoral officer Peter Erben described it as a "peaceful and good election" free of significant security incidents and said he thought turnout had been high, although election observers said it appeared fewer had voted than in last year's presidential election, which saw a 70% turnout.
A huge security operation was mounted to protect voters, involving 100,000 troops, about 20,000 from a US-led force and 10,000 Nato-led peacekeepers, after more than 1000 people died in violence in the months ahead of the election
The deaths included seven candidates and six poll workers.
The $159-million polls were part of an international plan to restore democracy after US-led forces overthrew the Taliban in 2001.
Sunday's parliamentary election followed October presidential polls won by Karzai.
In the 249-seat national assembly, 68 seats are reserved for women, and election officials said there appeared to have been a high turnout of women in some conservative areas where their participation had been in doubt.
Legislative candidate Yunus
Qanuni (R) votes in Kabul
"I am so happy, so happy," said Khatereh Mushafiq, 18, her black veil decorated with white flowers pulled back from her beaming face as she went to vote at a girl's school in Kandahar.
"We are also now taking part in the government and in society. People must take part, people must have a say."
Karzai called it a historic day.
"The Afghan people have proven once again that they know their interest, that they can work for tomorrow, that they have a vision and that they have voted for that vision," he said.
But he warned the vote would not end the insurgency.
"The attack on Afghanistan will continue tomorrow and the day after tomorrow," he said.
Boost for US
Even so, a successful poll will be a boost for the US administration, allowing it to portray Afghanistan as a success to set against the gloom from Iraq and Hurricane Katrina.
The election is expected to produce a fragmented national assembly focusing on local interests, which some analysts say may be more of a help than a hindrance to Karzai.
Afghan workers at the Eidgah
mosque voting centre in Kabul
Many Afghans have been dismayed that regional commanders blamed for rights abuses have been able to run in the elections.
Erben said counting would start on Tuesday and take about 16 days with final results on 22 October.
Yunus Qanuni, runner up to Karzai last year and now leading an opposition bloc, predicted before the polls that his alliance would win half the seats.
Karzai, who did not campaign for these elections, said he would welcome opposition from a new parliament.