An American soldier has been shot by an Afghan ally at a checkpoint, bringing to 2,000 the grim tally of US war dead in Afghanistan.
An American civilian also died in the shooting near a base in Wardak province. Two members of the Afghan army were also killed.
It was the latest green on blue attack, in which Afghan soldiers or police officers turn their guns on their erstwhile allies. More than 50 foreign troops have been gunned down in green on blue attacks this year alone.
A government spokesman said: "Initial reports indicate that a misunderstanding happened between Afghan army soldiers and American soldiers."
He added that investigators had been sent to the site to piece together what happened. It was unclear whether the attacker was killed.
The green on blue attacks are corroding trust between allies and local forces and have are regarded by some senior officers as the greatest treat to the Nato mission succeeding in the 11-year war.
US generals scaled have back cooperation with Afghan troops to both sides working only in small units to minimise the risk.
That has had a knock-on effect on a key part of the Allied strategy which seeks to train local forces in time for the December 2014 date for the withdrawal of foreign troops.
Speaking about the attacks, Gen John Allen told CBS's 60 Minutes: "I'm mad as hell about them.
"It reverberates everywhere across the United States. We're willing to sacrifice a lot for this campaign but we're not willing to be murdered for it," said the top commander of US and Nato forces in Afghanistan.