An Afghan ex-pilot opened fire after a row at a Kabul training centre Wednesday, leaving eight US troops and an American contractor dead in the worst attack of its kind in almost a decade of war.
Although the killings appear to have stemmed from a disagreement rather than a rebel attack, they highlighted the prevailing insecurity in Afghanistan, 10 years after a US-led invasion ousted the Taliban from power.
The deaths are also likely to raise fresh questions over the massive NATO-led effort to expand and train Afghanistan's military and police so they can take control of security when foreign combat operations end in 2014.
The NATO-led International Security Assistance Force (ISAF) confirmed that eight of its troops and one civilian who were training Afghan forces died in the shooting. A Pentagon spokesman said all nine fatalities were American.
Afghan defence ministry spokesman Mohammad Zahir Azimi said the shootings happened at around 11:00 am (0630 GMT) when "an argument took place between an (Afghan) air force officer and foreign colleagues".
Colonel Mohammed Bahadur Raeeskhail, the Afghan air force's media relations chief, said the shooting came as Afghan and international staff gathered in a conference hall for a regular briefing.
He identified the 45-year-old gunman as a former pilot who had been working as an air force administrator.
"We don't know what exactly happened to trigger the shooting," added Raeeskhail. It was also not immediately clear if all nine Americans died from bullets fired by the former pilot.
The gunman was shot dead by Afghan soldiers following the killings, which took place at NATO's Air Training Command Afghanistan centre on a site shared by Kabul's military and civilian airports.
The Taliban claimed responsibility for the incident in a text message to AFP, but are known routinely to exaggerate their claims.
An Afghan official, speaking on condition of anonymity, said the gunman was from a well-respected Kabul family and that the shooting was the result of a disagreement, not terrorism.
He is thought to have used a pistol in the shooting, the source added.
The incident was condemned by President Hamid Karzai, who said that five members of the Afghan air force were also wounded. He vowed to launch an investigation.
The deaths represent the highest number of foreign forces killed in a single incident since September, when nine ISAF troops died in a helicopter crash.
It is also thought to be the deadliest incident for NATO troops targeted as they trained up Afghan forces.
There is a history of Afghan troops attacking foreign soldiers who have been mentoring them ahead of limited foreign troop withdrawals due to start in July.
Last November, six US troops were shot dead during a training session in eastern Afghanistan, apparently by a member of the Afghan border police.
NATO efforts to train and equip local forces so they can take responsibility for security across Afghanistan by 2014 have also been hit by a string of recent attacks by militants who have apparently infiltrated the armed forces or who attacked while wearing unauthorised uniforms.
The defence ministry in Kabul was targeted last week by a gunman in army uniform wearing a suicide vest, in an attack that left three people dead.
The latest incident came as US media reported that President Barack Obama was to nominate his war commander in Afghanistan, General David Petraeus, to succeed Leon Panetta at the helm of the CIA.
ABC and NBC television reported that Petraeus will be replaced in Afghanistan by Lieutenant General John Allen, the current deputy head of US Central Command.
The commander of the NATO mission to train Afghanistan's military, Lieutenant General William Caldwell, has called 2011 a "pivotal" year in which the total number of Afghan military and police should rise to over 300,000. The figure currently stands at over 180,000.
There are around 130,000 international troops serving in Afghanistan, the bulk of them from the United States, although Afghan forces are in control of security in Kabul.