(Adds confirmation of general's name, Army statement)
By Hamid Shalizi and Jessica Donati
KABUL, Aug 5 (Reuters) - A U.S. general was killed and more than a dozen people were wounded on Tuesday, 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.
The U.S. Army said late on Tuesday the slain general was 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 the war in Vietnam, military officials said.
"These soldiers were professionals, committed to the mission," U.S. Army Chief of Staff Ray Odierno said in a statement, referring to the soldiers killed and wounded in the attack.
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 machine gun. 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, adding that 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 the country'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.
"We remain committed to our mission in Afghanistan and will continue to work with our Afghan partners to ensure the safety and security of all coalition soldiers and civilians," Odierno said.
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 a Pentagon report on the war in April, 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 countries, 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 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 Afghanistan's eastern province of Paktia 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 and Phil Stewart 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, G Crosse Grant McCool)