A man believed to be an Afghan soldier opened fire at an Afghan military academy in Kabul on Tuesday, killing a U.S. general and wounding up to 15 other personnel, including a German general and eight Americans, U.S. and coalition officials said.

Army Maj. Gen. Harold J. Greene, deputy commanding general of Combined Security Transition Command-Afghanistan in Kabul, is the highest-ranking U.S. service member killed in Iraq or Afghanistan.

U.S. officials said five of the eight wounded Americans are in serious condition; a number of British soldiers and three Afghan troops were also wounded.

Greene previously served as the Army’s deputy for acquisition and systems management, a role in which he oversaw acquisition reform initiatives. He was commissioned as an engineer officer in 1980 after graduating from Rensselaer Polytechnic Institute in Troy, N.Y.

The attack occurred about 12:23 p.m., according to an official at the German Embassy in Washington, who confirmed the wounding of a German brigadier general in the attack. The assailant was killed, said Rear Adm. John Kirby, the Pentagon press secretary. He would not say whether the shooter was killed by coalition troops or Afghans.

Afghan National Army soldiers keep watch at the gate of military training academy in Kabul province Tuesday after a man in an Afghan army uniform fired on a visiting military delegation. (Omar Sobhani/Reuters)

“It’s a terrible day. It’s a terrible tragedy,” said Kirby, adding that coalition officials have no reason to believe that the shooter was not a member of the Afghan National Security Forces.

The attack occurred at the Marshal Fahim National Defense University, said the U.S.-led International Security Assistance Force (ISAF). The facility, in the Qarga district of Kabul province and west of the city, was known as the Afghan National Defense University until this year. It was renamed after the Afghan vice president and former military commander who died in March of an undisclosed illness.

A spokesman for the Afghan Defense Ministry, Gen. Mohammad Zahir Azimi, and other Afghan officials described the attacker as a “terrorist dressed in an Afghan army uniform” who opened fire on a delegation of military visitors.

A Taliban spokesman issued a statement early Wednesday on the military academy attack, praising the shooter’s actions but not claiming responsibility. The spokesman e-mailed a statement to journalists in Afghan Pashto saying that a “sensible Afghan” had killed an Italian general and three American soldiers. The facts were not correct because the only American killed was Greene. No Italian officer was harmed but a German general was shot and seriously wounded.

Sources at the Defense Ministry said the attacker had been a member of the Afghan National Army for the past two years and was from southeastern Afghanistan. They did not identify him. They said he used a light assault rifle to fire on the foreign military delegation before he was fatally shot by Afghan personnel.

President Obama received a briefing on the attack from the ISAF commander, Gen. Joseph F. Dunford, White House press secretary Josh Earnest said. Earnest reiterated that the administration believes that while Afghanistan remains a “dangerous” place, its security needs must be met by the Afghan government.

“While we have made tremendous progress in disrupting, dismantling and defeating al-Qaeda operations and leadership in Afghanistan and progress in winding down U.S. involvement in that conflict, this shooting is, of course, a painful reminder of the service and sacrifice that our men and women in uniform make every day for this country,” Earnest said.

The shooting occurred as plans for the future presence of U.S. troops in Afghanistan, after the final withdrawal of combat forces in December, remained in limbo. Delays continued in the slow process of auditing votes from the June runoff between presidential candidates Ashraf Ghani and Abdullah Abdullah, who have accused each other’s campaigns of fraud.

Although Obama has said that 9,800 U.S. troops will remain for training and counterterrorism missions, their presence would require the new Afghan president to sign a bilateral security agreement with the United States. Inauguration of a successor to President Hamid Karzai, originally scheduled for last Saturday, has been indefinitely postponed.

Both candidates agreed in July, in a deal brokered by Secretary of State John F. Kerry, to form a unity government after a complete recount of all 8 million votes cast. So far, only about 10 percent of the votes have been counted amid continuing controversy over which ballots should be invalidated, and the candidates themselves reportedly have made little progress in discussions on the terms of a power-sharing arrangement.

Karzai said in a statement that the victims of Tuesday’s attack were visiting the academy as part of an effort “to help us build up the Afghan security forces.” He blamed the assault on “enemies who don’t want to see Afghanistan have strong institutions.”

The senior United Nations official in Afghanistan issued a statement of condolence Tuesday night to the families and colleagues of “international and Afghan troops killed and wounded” in the attack. The statement from Jan Kubis, the U.N. special representative for Afghanistan, said international forces “continue to perform a critical role in Afghanistan’s security and are providing critical training for the country’s future and stability.” He called the attack a “tragedy.”

The academy is a centerpiece of the coalition’s plan to train the Afghan military. U.S. military officials have described it as “the West Point of Afghanistan,” a reference to the U.S. Army’s military academy in New York state.

The shooting Tuesday was one of a few major incidents of so-called insider attacks against Western forces in Afghanistan in recent months. Such attacks by Afghan trainees or soldiers against their Western instructors or colleagues grew in frequency over the past several years but tapered off as a result of stricter security and screening measures at military facilities.

However, the number and scope of Taliban insurgent attacks has been increasing in recent months, with dozens of deadly incidents involving unusually large numbers of insurgents. Officials have said the Taliban is testing the strength of Afghan security forces as U.S. and NATO troops continue their withdrawal and prepare to place the nation’s defense largely in Afghan hands.

Insider attacks have been a core concern of coalition troops in Afghanistan for years. As of June 24, there had been 87 there since 2008, killing 142 coalition troops and wounding an additional 165, according to a tally kept by the Long War Journal.

The motives for the attacks have varied. In some cases, insurgents have infiltrated the Afghan military and police and waited for the opportunity to attack coalition troops. In others, Afghan troops have attacked the coalition troops training them after feeling personally offended, military officials have said.

The worst year for insider attacks in Afghanistan was 2012, when 44 attacks killed 61 coalition troops, according to the Long War Journal. The rash of attacks that year prompted significant changes in the way Western and Afghan military service members interact. They included appointing “guardian angel” service members to stand guard while coalition troops and Afghans worked together. Insider attacks have been significantly down this year, with two recorded before Tuesday.

Constable reported from Kabul. Karen DeYoung and Katie Zezima contributed to this report.