A Pentagon spokesman told CNN that the injured included 15 U.S. troops.
NATO released a statement confirming the "security incident" occurred at Camp Qargha, also known as the Kabul Afghan National Army Officer Academy, but did not provide additional details.
According to the German military, the assailant was clad in an Afghan military uniform. The German military said that the wounded included a German brigadier general.
The Afghan Defense Ministry noted that the "terrorist" had been killed by Afghan soldiers.