Three US troops were killed and another wounded during a joint operation in Afghanistan's eastern Nangarhar province, the Pentagon said, in the latest so-called insider attack on international forces.
The Taliban claimed responsibility for the deaths in the volatile district of Achin, which is also contested by Islamic State jihadists, saying it was carried out by an infiltrator.
The Pentagon said in a statement yesterday that the wounded soldier had been evacuated for medical treatment.
"This incident is under investigation," the statement added.
Earlier, provincial spokesman Attaullah Khogyani told AFP that an Afghan commando had opened fire on US troops and was killed in return fire.
Taliban spokesman Zabihullah Mujahid claimed on Twitter that four US soldiers were killed in the attack. The insurgents are known to exaggerate battlefield claims.
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.
So-called "green-on-blue" attacks -- when Afghan soldiers or police turn their guns on international troops -- 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.
Yesterday'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 American troops were wounded in March when an Afghan soldier opened fire in southern Helmand province, 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.