A man in Afghan military uniform opened fire on NATO troops at an army training centre in Kabul on Tuesday, reportedly killing a US general and wounding at least 19 other people, including a senior German officer.
The attack came as a major blow to NATO's efforts to train up the Afghan military before foreign forces end their combat mission in December after 13 years of fighting the Taliban.
The New York Times and NBC news, citing unnamed sources, said a US major general had been shot dead in what would be the highest-level fatality of the war.
Among the injured in the attack at the Marshal Fahim National Defense University were 15 US troops, three Afghan soldiers and a German brigadier general, officials said.
Details of the incident were scarce, and the total number of foreign casualties was not immediately clear.
"A terrorist wearing Afghan army uniform opened fire at national army officers and their foreign colleagues and wounded several people," defence ministry spokesman Mohammad Zahir Azimi said on Twitter.
The British-run Afghan National Army Officer Academy is part of the university, but the NATO's International Security Assistance Force clarified an earlier statement that said the attack was inside the academy.
"ISAF confirms that an incident occurred today involving local Afghan and ISAF troops at the Marshal Fahim National Defense University," the force said. "ISAF can confirm one ISAF service member was killed."
A US official in Washington confirmed to AFP that the dead man was an American serviceman, but declined to comment on his identity.
President Hamid Karzai condemned the attack as a "cowardly" strike against Afghan and NATO officers who were visiting the military training university on the outskirts of the capital.
"It is the work of those enemies who do not want to see Afghanistan have its own strong institutions," he said.
General Mohammed Afzal Aman, the chief of staff for operations at the Afghan Ministry of Defence, told AFP that three Afghan army officers were injured.
"ISAF have quarantined the site, allowing nobody, including Afghan forces, to approach," he said.
An official statement from Berlin said the injured German brigadier general was not in a life-threatening condition.
- Afghan army under pressure -
The Afghan military has been built from scratch since the fall of the Taliban regime in 2001, and it has struggled with high casualty rates, "insider attack" killings, mass desertions and equipment shortages.
If the attack was by an Afghan army officer, it would be latest incident in which Afghan soldiers have turned their guns on their allies.
Scores of US-led troops have been killed in "insider attacks" in recent years, breeding fierce mistrust and forcing joint patrols to be overseen by armed guards.
Western officials say that most such attacks stem from personal grudges and cultural misunderstandings rather than Taliban insurgent plots.
The shootings, also known "green on blue" attacks, declined rapidly last year as ISAF combat troops closed many bases and reduced operations before their complete withdrawal.
"We are aware of reports of an incident," the British ministry of defence said in a statement issued from London.
"The incident is under investigation and it would be inappropriate to comment further at this time."
In February this year, two Afghan men wearing military uniforms shot dead two US soldiers in the eastern province of Kapisa.
Also on Tuesday, Afghan officials accused an ISAF air strike of killing four civilians in the western province of Herat.
"After rockets were fired at Shindand airbase, an aircraft carried out strikes on the area where they were launched," Herat's deputy governor Asiludin Jami told AFP.
"A man, a woman, a kid and a teenager were killed. They were all civilians."
ISAF said it took all allegations of civilian casualties seriously, and was assessing the facts surrounding Monday's incident.
Afghanistan is holding an audit of eight million votes cast in presidential elections after a dispute over fraud threaten to trigger a spiral of ethnic violence.