(Adds confirmation general is highest-ranking military official killed overseas since Vietnam War)
By Hamid Shalizi and Jessica Donati
KABUL, Aug 5 (Reuters) - A U.S. general was killed and more than a dozen people were wounded, including a German general, in the latest insider attack by a man believed to be an Afghan soldier, U.S., German and Afghan officials said on Tuesday.
The slain general was identified in U.S. media reports as Major General Harold Greene, a senior officer with the international military command ISAF. He was the most senior U.S. military official killed in action overseas since since the war in Vietnam, U.S. military officials said.
The Pentagon declined to confirm Greene's identity.
Pentagon spokesman Rear Admiral John Kirby told reporters that "many were seriously wounded" and the gunman was killed in the attack, which took place on Tuesday at the Marshal Fahim National Defense University, a training center in Kabul.
The attack raised fresh questions about the ability of NATO soldiers to train and advise Afghan security forces as western nations gradually withdraw. The U.S. and German generals were on a routine visit, the Pentagon said.
A U.S. official said the gunman fired on the foreign soldiers using a light machinegun. Afghanistan's Defense Ministry described him as a "terrorist in army uniform."
The German military said its general was one of 14 coalition troops wounded in Tuesday's attack. It said his life was not in danger. Seven Americans and five British troops were among the wounded, an Afghan official said.
Past insider attacks have eroded trust while straining foreign efforts to train Afghanistan's 350,000-strong security force and prepare them to fight the Taliban once most U.S. and NATO forces depart.
U.S. Defense Secretary Chuck Hagel spoke by phone with General Joe Dunford, who commands U.S. and international troops in Afghanistan, about the incident, Kirby said. He said the shooting was being investigated jointly by Afghan authorities and the international military coalition that is winding down its long mission in Afghanistan.
The Afghan president was quick to condemn the attack, saying the delegation had been visiting the facility to help build Afghanistan's security forces.
The Taliban says insider attacks reflect their ability to infiltrate the enemy. International military coalition officials say the incidents often arise over misunderstandings or altercations between troops.
U.S. military officials said it was too soon to say whether the high-ranking officers had been specifically targeted by the shooter.
In 2012, dozens of incidents forced international troops to take measures to reduce interaction with their Afghan partners. Since then, the number of insider attacks has fallen sharply.
According to an April 2014 Pentagon report on the war, there were 15 insider attacks against foreign troops in 2013, down from 48 in 2012.
"Despite this sharp decline, these attacks may still have strategic effects on the campaign and could jeopardize the relationship between coalition and ANSF personnel," the report stated. "Insurgents remain intent on utilizing insider attacks as an integral component of their asymmetric strategy."
The report concluded that armed guards known as 'guardian angels' accompanying coalition officials had reduced casualties by counter-attacking those who tried to kill foreigners.
Meanwhile, insider attacks against Afghan forces were on the rise, the report said.
Like other western nations, the United States is planning to leave a residual force in Afghanistan after the NATO mission ends this year, mainly focused on supporting Afghan forces. But U.S. officials say that first they must sign a bilateral troop deal, which cannot be finalized until Afghanistan resolves an election dispute and swears in a new president.
The Western departure will leave Afghanistan's forces, built from scratch since 2001 and still struggling with problems of incomplete training, illiteracy and desertion, in charge of the bulk of the fight with the Taliban.
Pentagon spokesman Kirby said that despite protective measures it would be impossible to eliminate the threat of such attacks entirely.
"The insider threat is ... a pernicious threat. And it's difficult to always ascertain," Kirby said. "Afghanistan is still a war zone."
Ed Royce, chairman of the U.S. House of Representatives Foreign Affairs Committee, said the progress in protecting foreign troops serving in Afghanistan had been inadequate.
"Many brave U.S forces are working hard to help stand up the Afghan forces so they can continue to take the lead in Afghanistan," he said. "They don't deserve to be victims of such cowardly terrorist attacks."
In a similar attack on Tuesday, several people were wounded in eastern Paktia province when a policeman opened fire on international and Afghan forces, police chief Zalmay Oryakhil said.
Adding to the tension, a NATO air strike hit a vehicle carrying civilians in western Herat province, local officials said, killing four members of a family returning from a wedding, including two children. (Additional reporting by Missy Ryan in Washington, Sabine Siebold in Berlin, Krista Mahr in Kabul, Jalil Ahmad Rezaee in Herat and Ahmad Sultan in Gardez; Editing by Janet Lawrence, Howard Goller and Grant McCool)