"Perhaps up to 15" coalition troops, including other Americans, were wounded in the attack, said Rear Adm. John Kirby.
The gunman, who was killed, was believed to be an Afghan soldier who had served for some time, Kirby said.
The general's killing marks the "one of the highest-ranking deaths in the war since 9/11," Kirby said.
The general was not being identified pending notification of relatives, Kirby said.
The bloodshed happened at Marshal Fahim National Defense University in Kabul, said NATO's International Security Assistance Force in a statement, clarifying earlier information from ISAF which reported that the shooting happened at Camp Qargha.
The German military said that the violence broke out during a "key leader" event. It also said that one person was killed and 14 were injured, including a German brigadier general.
The Afghan Defense Ministry described the shooter as a "terrorist" and said Afghan soldiers shot him dead.
In the past, people dressed as Afghan security forces have attacked coalition forces who have worked to thwart such violence.
In 2012, so-called "green on blue" attacks took the lives of dozens of coalition troops, and the U.S. command in Kabul halted some joint operations with Afghan security forces, CNN has previously reported.
Two attackers wearing Afghan military uniforms killed two U.S. service members in February in Afghanistan, military publication Stars and Stripes reported.
In October 2013, a man in an Afghan soldier's uniform shot and killed a member of ISAF in eastern Afghanistan, CNN reported.
According to an April 2013 Pentagon report, insider attacks against ISAF forces declined from 48 attacks in 2012 to 15 attacks in 2013. In the first quarter of 2014, there were two insider attacks against ISAF.
"Despite this sharp decline, these attacks may still have strategic effects on the campaign and could jeopardize the relationship between coalition and ANSF [Afghan National Security Forces] personnel," the report reads.
(Ashley Fantz and Jim Sciutto, CNN)
Copyright 2015 Nexstar Broadcasting, Inc. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.