The attacker was wearing an Afghan army uniform, but the Taliban sometimes dresses up someone in a friendly uni and sends them into a military base with orders to kill.
But in this case, the attacker appears to be a genuine Afghan soldier, although he may have had Taliban sympathies:
A man wearing an Afghan National Army uniform opened fire on coalition troops in eastern Afghanistan on Friday, killing an American and wounding two others, officials said.
"An Afghan Army soldier turned his weapon against US soldiers inside an Afghan-US military base in Kunar Province, killing one US soldier and injuring two others," provincial police chief Ewaz Mohammad Naziri told AFP.
The Taliban claimed responsibility for the attack.
Zabihullah Mujahid, a Taliban spokesman, claimed in a text message sent to AFP that 12 American soldiers were killed. The group often exaggerates casualty figures.
Earlier, NATO's mission in Afghanistan, the International Security Assistance Force (ISAF), said in a statement that "an individual in Afghan army uniform turned his weapon against coalition service members in eastern Afghanistan today, killing one service member."
It comes just four days after three coalition troops were killed by an improvised explosive device (IED) in eastern Afghanistan.
On Sunday, another soldier was killed in an IED attack, and a man wearing an Afghan National Army uniform shot dead one coalition service member in southern Afghanistan.
The Taliban announced the start of its "spring offensive" last Thursday. Seven Afghans, many of them children, died after a large bomb exploded in Kabul last week, with the Taliban claiming responsibility.
That's a total of 20 dead NATO soldiers in 15 separate attacks this year.