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.
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.
More From This Section
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.
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.
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.