The Taliban quickly claimed responsibility in what would be the latest attack by an insurgent infiltrator.

NATO officials did not identify the slain soldiers or their nationalities, and officials at both the State and Defense departments said they could not confirm reports that six of the dead were Americans.

The pilot began shooting during a meeting in the operations room of the Afghan National Army Air Corps building about 10 a.m. after having an argument with a foreign colleague, targeting foreign instructors and advisors, according to statements released by NATO and Afghan officials.

Afghan security forces heard the shots and surrounded the building, storming inside even as other officers leapt from the building's second floor, according to Col. Bahader, the Afghan army's spokesman at the airport, who goes by one name. None of the Afghan personnel died in the attack, he said.

Inside the building, NATO forces returned fire, killing the attacker, Afghan officials said. A NATO soldier and five Afghan air force troops were wounded in the gunfight, officials said.

A NATO quick-reaction force responded to the scene, and alliance and Afghan officials were still investigating late Wednesday.

The pilot, Ahmad Gul, 48, was from the Tarakhail district of Kabul province and had served in the Afghan army for 20 years, according to a man who claimed to be his brother.

Hassan Sahabi, a Kabul pharmacist, appeared on Afghanistan's Tolo television Wednesday to say his brother was not a Taliban sympathizer but that he had been troubled lately by financial problems that forced him to sell his house.

Reached by phone late Wednesday, Sahabi declined to comment further.

A Taliban spokesman offered a different account of the attack.

He claimed the shooter, who he identified as Azizullah, was an insurgent from Kabul's conservative Arzan Qimat neighborhood on the city's outskirts who succeeded in posing as a pilot with help from Afghan security forces and died when he ran out of bullets.

“The Afghan air force corps officers fully helped the suicide attacker to get in and start shooting at [Afghan] and foreign soldiers,” Taliban spokesman Zabiullah Mujahid said.

Reporters were not allowed into the compound Wednesday, and Afghan air force officers at the scene declined to comment. Gen. Abdul Wahab, the air force's commander, also declined to comment, an aide said, citing the ongoing investigation.

The Afghan air force, formerly the Afghan National Army Air Corps, has benefited from years of training and upgrades by U.S. forces. But it has also seen rapid recruitment as the ranks of Afghan security forces has grown to at least 305,000, raising fears of Taliban sleeper agents among new recruits.

The air force has grown to include about 5,000 troops, Bahader said, more than doubling in size since 2008, when they inaugurated their new headquarters at the airport. The force is equipped with 26 new or refurbished aircraft, including transport helicopters and Ukrainian military planes bought with U.S. funding.

U.S. Air Force Lt. Col. David Simons, a spokesman for the alliance training mission, said the NATO Air Training Command based at the airport “has gone through numerous upgrades to secure the facilities both on the Afghan side and the U.S. side.”

He said 95% of the Afghan air force personnel has been vetted with biometric screening, but declined to comment about whether the shooter had been screened.

Afghan President Hamid Karzai ordered the Defense Ministry to investigate the shooting and other recent incidents that involved insurgents posing as or infiltrating the ranks of the security forces.

Such attacks are part of a Taliban strategy to undermine the Afghan population's faith in NATO troops and their own military as the U.S. prepares to begin drawing down its forces this summer, said Martine van Bijlert, co-director of the Afghanistan Analysts Network, a Kabul-based think tank.

She cited two recent Taliban assassinations of prominent local officials, an attack earlier this month by a uniformed Afghan soldier within the Defense Ministry and the weekend prison break in the southern city of Kandahar that freed 488 inmates, most Taliban members.

Afghan authorities say they suspect someone inside the prison assisted the escape.

Although Afghan authorities held a news conference to parade recaptured escapees before the cameras, by late Wednesday they had managed to find only 75 of the missing prisoners, to the Taliban's delight.

“The image they're portraying is, 'We're everywhere. We're the one who are staying and we can go wherever we want,' ” Van Bijlert said.

[email protected]

Special correspondents Aimal Yaqubi and Hashmat Baktash contributed to this report.