Saturday's shooting took place at an Afghan army checkpoint just outside a joint US-Afghan base in Wardak province, said Shahidullah Shahid, a provincial government spokesman. At least two Afghan soldiers also died, he said.
"Initial reports indicate that a misunderstanding happened between Afghan army soldiers and American soldiers," Shahid said.
He said investigators had been sent to the site. It was not clear if the assailant was killed. The attack happened about 5pm local time in Sayd Abad district, the Afghan defence ministry spokesman, General Zahir Azimi, said in a statement.
He did not provide further details.
Nato forces said the shooting was a "suspected insider attack" and confirmed that a Nato service member and civilian contractor were killed.
One US official confirmed that both were American. Afghan soldiers and police officers or militants in their
uniforms have killed more than 50 foreign troops so far this year.
An equal number of Afghan police officers and soldiers also died in these attacks, raising suspicions of possible infiltrators within their ranks.