Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

KABUL, Afghanistan — A U.S. Army two-star major general was killed Tuesday in an insider attack at an Afghan military training facility, U.S. Defense and military officials told NBC News. He was later identified as Maj. Gen. Harold Greene, a native of upstate New York.

More than a dozen Western soldiers in all — including several Americans — were shot as high-level officials visited the heavily guarded military complex.

The carnage started when a lone gunman dressed in an Afghan army uniform opened fire with an automatic weapon during a meeting at the Afghanistan National Military Academy, located at the Marshal Fahim National Defense University in Kabul. The officials said the death toll is expected to rise given the severity of troops’ injuries.

Officials earlier told NBC News that three Western troops had died but later revised the figure. There was no immediate explanation for the discrepancy, however, death tolls often fluctuate in the confusing aftermath of such attacks.

The NATO-led International Security Assistance Force confirmed that one of its service members died in an "incident" which is under investigation. It also clarified where the incident took place, after previously describing the location as Camp Qargha, which houses the university — along with several other military institutions.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Gen. Mohammmad Zahir Azimi, a spokesman for Afghanistan's Defense Ministry, tweeted in Dari that the gunman was wearing an Afghan military uniform and was shot dead after opening fire on Afghan and international colleagues.

A senior security source told NBC News that the suspected gunman was a bodyguard of the Paktia provincial governor, and his fellow soldiers killed him during the ambush.

Germany's military said in a statement that 15 troops had been wounded in the attack, including a German brigadier general, according to The Associated Press. Those details could not immediately be independently confirmed by NBC News.

Afghan President Hamid Karzai described the incident as "cowardly" and offered his condolences to the victims' families.

Camp Qargha, which is overseen by the British military, is sometimes called "Sandhurst in the sand" — a reference to the U.K.'s own officers' training school.

Training Afghanistan's 350,000 strong security forces is a large part of the current NATO-led operation, especially as the U.S.-led coalition prepares to hand over combat operations by the end of 2014.

An Afghan intelligence source told NBC News that a high-level ISAF delegation was visiting and touring the academy when the shooter opened fire from a window. Two senior Afghan officers also were injured in the attack, the source added, speaking on condition of anonymity because he was not authorized to speak to the media.

The U.K. Ministry of Defense said Wednesday that it was aware of reports and that the incident is under investigation.

Retired U.S. Army Col. Jack Jacobs said these attacks usually stem from troops being disgruntled about assignments or their pay — and not because they were "planted" by the enemy.

"It’s very disturbing in any case," Jacobs told NBC News, "and particularity so because we spend a great deal of time and money for Afghan troops to take over the defense of their country by themselves."

NBC News' Alexander Smith and The Associated Press contributed to this report.