Pentagon Press Secretary Rear Admiral John Kirby told reporters in Washington that an American general was killed, but did not name the officer.
The American major general, the highest ranking U.S. official to be killed in Afghanistan, was reportedly shot at close range during what Kirby called a “routine site visit” by senior officers to the Marshal Fahim National Defense University in Kabul.
Also injured were a number of other members of the international security force in Afghanistan, including a German brigadier general.
In a statement, the International Security Assistance Force (ISAF) confirmed that the attack took place at a British military training academy in the capital. It said one ISAF service member was killed, without giving details, and the incident was under investigation.
In addition to the American general who died, U.S. officials said another 15 international soldiers were wounded, and that several Americans were among the injured.
According to the Afghan official, seven U.S. soldiers and five British troops were among the wounded in the attack at the training center.
The total number of foreign casualties was not immediately clear.
The U.S. official said that some of the injuries were serious as the gunman shot at fairly close range, according to the French news agency AFP.
The U.S. official and Afghan officials confirmed that someone wearing an Afghan military uniform opened fire about 12 p.m. local time at the camp where international forces train Afghan National Army officers.
An Afghan Defense Ministry statement described the attacker as a “terrorist” and said he had been killed.
Afghan President Hamid Karzai condemned the shooting, saying the delegation had been visiting the facility to help build Afghanistan’s security forces.
Officials in Kabul said three Afghan officers were wounded in the shooting at the British-run academy.
The gunman was using a light machine gun, according to the U.S. official.
The attack comes as so-called “insider attacks” – incidents in which Afghan security turn on their NATO partners – largely dropped last year.
In 2013, there were 16 deaths in 10 separate attacks. In 2012, such attacks killed 53 coalition troops in 38 separate attacks.
Such attacks have eroded trust between the allies and complicated efforts to train Afghanistan’s new 350,000-strong security force.
As of Aug. 1, the U.S. had 30,600 troops in Afghanistan. There were also 17,100 allied troops.
In a second, similar attack on Tuesday, several troops were wounded in eastern Paktia province when a policeman opened fire on international and Afghan forces, police chief Zalmay Oryakhil told Reuters.
Such attacks’ are sometimes claimed by the Taliban insurgency as proof of their infiltration.
Others are attributed to personal disputes or resentment by Afghans who have soured on the continued international presence in their country more than a dozen years after the fall of the Taliban’s ultra-conservative Islamic regime.
In 2012, dozens of incidents forced international troops to take measures to reduce interaction with their Afghan partners and since then, the number of insider attacks has fallen sharply.
Adding to the tensions between the allies on Tuesday, a NATO airstrike hit a vehicle carrying civilians in western Herat province, local officials said, killing four members of one family including two children.
“We strongly condemn the killings by foreign troops and we have reported this to the presidential palace,” deputy provincial governor, Aseeluddin Jameh, told Reuters.
The family was returning from a wedding in Shindand district.
Jeff Seldin contributed to this report from the Pentagon. Ayaz Gul contributed to this report from Pakistan. Some information for this report provided by AFP, AP and Reuters.