The unidentified gunman, who was later killed, opened fire while the Americans were at the gate of an Afghan military ammunition supply depot near Camp Moreshead outside Kabul.
A gunman, reportedly in an Afghan army uniform, shot dead two American advisers and wounded three on Wednesday near a base outside the Afghan capital before being killed himself, officials said.
The deaths included one soldier and one civilian, while another American soldier and two civilians were injured and in stable condition, the US military command in Kabul said.
"The two individuals were killed during an attack near a coalition base by an unknown assailant, who was later killed," it said in a statement.
"They were conducting duties as part of the larger Nato mission to train, advise and assist the Afghan security services."
The lone gunman opened fire while the Americans were at the gate of an Afghan military ammunition supply depot near Camp Moreshead outside Kabul, said a US official.
US officials said they were investigating the incident.
The shooting took place at about 11 am, while the international troops were visiting a base in Kabul, said Dawlat Waziri, an Afghan Defence Ministry spokesman.
While the suspected attacker remains unidentified, reports indicate he was wearing an Afghan army uniform, he said. Waziri had earlier indicated thatt he incident was an "insider attack."
So-called "green-on-blue" insider attacks by Afghan troops on international service members have occurred periodically over the years but have become much less frequent as a result of improved security measures.
Insider attacks have also plagued Afghan troops, depleting morale and causing mistrust within security ranks.