A mass shooting at the Kabul airport has claimed the lives of eight American troops and an American contractor, who were gunned down by an Afghan military officer Wednesday morning.

Five Afghan soldiers were wounded in the same incident.

Those killed were trainers or advisers to the Afghan Air Corps. The shooting was the deadliest attack yet on NATO troops by a member of the Afghan security troops, or an insurgent impersonating one, to date.

There have been seven such attacks this year, and there are worries that the incidents of Afghan partners turning against NATO members reflects a growing anti-foreigner sentiment after a nearly decade-long war.

The Taliban took credit for the attack, but that assertion is not considered credible.

A spokesperson for the Afghan Air Corps said the shooting happened in an operations room at the Kabul airport.

"Suddenly, in the middle of the meeting, shooting started," said Col. Bahader, who uses only one name.

"After the shooting started, we saw a number of Afghan army officers and soldiers running out of the building. Some were even throwing themselves out of the windows to get away."

Afghan Defence Ministry spokesperson Gen. Mohammad Zahir Azimi said the shooter was involved in an argument before the incident at the meeting.

"An argument happened between him and the foreigners and we have to investigate that," he said.

He identified the shooter as Ahmad Gul, 48, an officer who has been a pilot in the Afghan military for 20 years. He was killed in a gunfire exchange following his attack.

The gunman's brother said he wasn't a Taliban sympathizer.

"He was under economic pressures and recently he sold his house. He was not in a normal frame of mind because of these pressures," his brother, Dr. Mohammad Hassan Sahibi, said. "He was going through a very difficult period of time in his life."

"He served his country for years," Sahibi told Tolo, a private television station in Kabul. "He loved his people and his country. He had no link with Taliban or al Qaeda."

Afghan President Hamid Karzai condemned the shooting.

Lt. Gen. William Caldwell, the NATO training mission commander, called the deaths a "tragic loss."

Since March 2009, there have been 20 incidents in which either Afghan soldiers or individuals wearing military uniforms have attacked coalition or Afghan forces.

According to NATO, half of these cases involved people impersonating soldiers or police officers, while the other 10 incidents were attributed to combat stress or unknown reasons.

Wednesday's attack comes less than two weeks after an Afghan soldier blew himself up inside a meeting of NATO trainers and Afghan troops at a military base in Laghman province, killing at least 10 people.

With files from The Associated Press