An Afghan commando who opened fire on American troops killed three of them and wounded another, US and Afghan officials said, in an insider attack that was claimed by the Taliban.
The so-called "green-on-blue" attack on Saturday is the latest in a line of incidents where Afghan soldiers have turned their weapons on international forces they are working with.
It also comes as the Taliban ramp up their campaign against the Western-backed government in Afghanistan, and as US President Donald Trump mulls sending more troops into the lengthy conflict.
Nangarhar provincial spokesman Attaullah Khogyani told AFP the Afghan commando had opened fire on US troops during an operation in the volatile Achin district.
"The (Afghan) soldier was also killed in the return fire," he said.
The Pentagon said the families of the three dead soldiers were being informed.
"One US soldier was wounded and has been evacuated for medical treatment," a spokesman added. "This incident is under investigation."
The Taliban claimed responsibility for the deaths, saying the attack was carried out by an infiltrator.
Spokesman Zabihullah Mujahid claimed on Twitter that four US soldiers were killed in the attack. The insurgents are known to exaggerate battlefield claims.
Achin is also contested by militants of the Islamic State group.
In April, the US military dropped its largest non-nuclear bomb ever used in combat on a complex of caves in Achin used by IS fighters.
The deployment of the so-called Mother Of All Bombs killed dozens of jihadists but fighting in the area has continued.
American troops have partnered with Afghan soldiers in raids against IS Khorasan, claiming the local offshoot of the jihadist group based in Iraq and Syria is steadily losing ground in Afghanistan.
- Mistrust bred by errant air strikes -
Green-on-blue attacks have been a major problem during NATO's long years fighting alongside Afghan forces.
Western officials say most insider attacks stem from personal grudges and cultural misunderstandings rather than insurgent plots.
Saturday's attack came just hours after an errant US air strike killed and wounded at least six Afghan policemen in southern Helmand province, in the latest "friendly fire" incident.
Such strikes have bred deep mistrust between local and foreign forces.
Three US troops were wounded in March when an Afghan soldier opened fire in Helmand, in the first known insider attack on international forces this year.
Similar incidents have also plagued Afghan troops, depleting morale and causing mistrust within security ranks.
The latest killings come at a time of intensified violence and when the United States is considering sending more troops to Afghanistan.
The Afghan conflict is the longest in American history, with US-led NATO troops at war there since 2001, after the ousting of the Taliban regime.
US troops in Afghanistan number about 8,400 today, and there are another 5,000 from NATO allies, who mainly serve in a training and advisory capacity.