An American special forces soldier has been killed while conducting operations against the Islamic State group in Afghanistan, the US military said.
The US-backed Afghan military has vowed to wipe out the group in its strongholds in the eastern province of Nangarhar as IS challenges the more powerful Taliban on its own turf.
"A US soldier was killed in action while conducting operations against ISIS-Khorasan in (Nangarhar) Afghanistan," US Navy Captain Bill Salvin said on Twitter, referring to a regional affiliate of the jihadist group.
The identity of the soldier, killed late on Saturday, was not revealed.
"On behalf of all of U.S. Forces - Afghanistan, I offer our deepest condolences to the family and friends of our fallen comrade," General John Nicholson, the top US commander in Afghanistan, said in a statement.
"We will always remember our fallen comrades and commit ourselves to deliver on their sacrifice," Nicholson added.
Nangarhar, which borders Pakistan, is a hotbed of IS militancy. US forces have conducted a number of air strikes on jihadist bases in the area since August last year.
IS, notorious for its reign of terror in Syria and Iraq, has been making inroads into Afghanistan in recent years. It has attracted disaffected members of the Pakistani and Afghan Taliban as well as Uzbek Islamists.
But the group has been steadily losing territory in the face of heavy pressure both from US air strikes and a ground offensive led by Afghan forces.
Islamic State's strength in Afghanistan has fallen to 600-800 fighters from 3,000 in early 2016, NATO has said, adding that it killed the top 12 IS commanders in the country last year.
The jihadists claimed a deadly assault on Afghanistan's largest military hospital last month, but survivors who spoke to AFP said the attackers chanted "Long live Taliban" in Pashto.
Last month three American troops have sustained injuries when an Afghan soldier opened fire on them in the southern province of Helmand, the first known "insider attack" on international forces this year.