Afghans have voted in a key parliamentary election, with turnout estimated at about 40%, although there have been a number of Taliban attacks.
At least 14 people were killed, the Afghan interior ministry said, including six security force members in a Taliban attack in the north.
There have also been some reports of fraud, including the washing off of supposedly indelible voting ink.
The poll is seen as a test of credibility for President Hamid Karzai.
More than 2,500 candidates are vying for 249 seats in the lower house of parliament, or Wolesi Jirga.
Afghan soldiers and police have been on alert, backed up by nearly 150,000 foreign troops.
Polls closed at 1130 GMT in the first vote since a fraud-marred presidential election last year.
Faizal Ahmad Manawi, head of the Independent Election Commission (IEC), said the 40% turnout figure was based on preliminary data and that this was "not a final figure".
He said 3,642,444 votes had been recorded so far at 4,632 reporting polling centres.
Earlier he said about 8% of the more than 5,800 polling stations that were expected to open had not done so or had not reported in, mostly as a result of security problems. Another 1,000 polling stations were earlier ruled out due to security.
Turnout for the last parliamentary election, in 2005, was about 50%.
There are more than 10 million registered voters. The UN had said a turnout of five to seven million would be a success, given the difficulty of holding a poll in the middle of a war.
A Nato spokesman told Agence France-Presse news agency there had been fewer incidents of violence than in last year's presidential poll. He said 303 incidents had been recorded by the time polling ended, compared with 479 on 20 August last year.
The Taliban had earlier warned voters to boycott the poll and "stick to jihad".
In what correspondents said was a thinly-veiled threat, the Taliban said it had "chalked out certain measures... to frustrate this American process and will implement them on the day when the illegitimate process of elections is conducted".
Among the scattered attacks across the country on polling day:
- One soldier and five pro-government militiamen were killed and six people were injured in an attack near a polling station in Baghlan province
- In Balkh province, three people were killed and four were injured in a rocket attack
- A spokesman for the governor of northern Takhar province told the BBC that two civilians were killed and three injured in a Taliban attack on a polling station
- A rocket fired in Kabul early on Saturday landed outside Afghanistan's state-owned TV station, close to the presidential palace and the Nato headquarters, police said
- Officials told the BBC that two polling stations in Jalalabad had been attacked and security forces were involved in gun battles with militants in three areas of the city
- The governor of Kandahar, Tooryalai Wesa, said his convoy was struck by an explosion while he was visiting polling centres, but no-one was injured
- There have been rocket attacks in Kunduz province, where international forces were involved in gun battles with militants.
The BBC's Lyse Doucet in Kabul says journalists have seen or reported a number of incidents of fraud, including the arrest of 26 people with fake identity cards in Helmand province, and officials stuffing ballot boxes at one closed polling station in eastern Wardak province.
Nader Nadery, of the Free and Fair Election Foundation for Afghanistan, told the BBC that although more people had voted than expected and casualties from attacks were lower than anticipated, there was a large number of irregularities in voting.
He said these included problems with the indelible ink, proxy votes, interference by local power brokers and a large amount of intimidation.
UN envoy to the country, Staffan de Mistura, told the BBC it was premature to say the vote had been a success. He said there were clearly security problems, particularly in the south, but that in many other parts of the country the vote had been "enthusiastic".
Despite the violence and threats, most voting centres opened on schedule and without incident on Saturday.
Government worker Mohammad Husman, 50, was at the front of the queue at a polling station in a school in Kabul.
"I came here because I want prosperity for Afghanistan, [and] stability for Afghanistan," he said.
"I am worried about security and fraud and I hope my vote goes to the person I picked to vote for," he added.
After casting his vote in central Kabul, President Karzai said he hoped people would not be deterred by security threats.
He said that by taking part in the election, Afghans would "take the country many steps forward into a better future".
Preliminary results are to be announced on 22 September, with the final results due on 31 October.
The outcome is not expected to change the make-up of the government although President Karzai's credibility may be damaged if his preferred candidates are defeated, or if vote-rigging is suspected.