The U.S. Defense Department has confirmed that a U.S. army general was killed when a man in Afghan army uniform opened fire at foreign troops in a military base west of Kabul on August 5.
Major General Harold Greene is the most senior U.S. officer killed in Afghanistan since the U.S.-led invasion in 2001.
Pentagon spokesman John Kirby said the attacker was an Afghan soldier and that he was killed after he opened fire.
The attack happened during a visit by NATO officers to the military school at Camp Qargha base.
Around 15 coalition soldiers were wounded.
The German army said a German general was among the wounded.
A statement said the general was not in a life-threatening condition.
Kirby said there were Americans among those wounded. Officials in Kabul earlier said three Afghan officers were injured in the attack.
The attack comes just months before international combat troops are due to withdraw from Afghanistan by the end of 2014.
Afghan President Hamid Karzai denounced the attack, describing it as "act by the enemies who don’t want to see Afghanistan have strong institutions."
In a statement sent to journalists, Taliban spokesman Zabihullah Mujahid praised the Afghan soldier who carried out the attack, as well as a police officer who carried out a similar attack in Paktia Province on August 5.
Mujahid did not claim the attacks.
The Qargha shooting comes as so-called "insider attacks" -- incidents in which Afghan security forces turn their weapons on their NATO partners -- largely dropped last year.
The attacks, which peaked in 2012, have eroded trust between the allies and complicated efforts to train Afghanistan's security force.