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 American deaths included one soldier and one civilian, while one soldier and two civilians were injured and in stable condition, the U.S. 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."

About 13,000 international troops and thousands of civilian contractors remain in Afghanistan to train and assist government forces battling Taliban insurgents who seek to reimpose fundamentalist Islamic rule 15 years after they lost power in a U.S.-led military intervention.

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 U.S. official.

The shooting took place at about 11 a.m., while the international troops were visiting a base in Kabul, said Dawlat Waziri, an Afghan Defense Ministry spokesman.

While the suspected attacker remains unidentified, reports indicate he was wearing an Afghan army uniform, he said. U.S. officials said they were investigating the incident.