The service member was identified Wednesday as Staff Sgt. Adam S. Thomas, 31, of Tacoma Park, Maryland. He was assigned to Company B, 2nd Battalion, 10th Special Forces Group (Airborne), Fort Carson, Colorado, the Department of Defense said.
"We are heartbroken by this loss, and we extend our deepest sympathies to the families and friends of the service member," Gen. John W. Nicholson, commanding officer for US forces in Afghanistan, said in a written statement Tuesday before Thomas' name was released.
He was killed during a patrol with Afghan forces when an improvised explosive device was triggered.
The incident took place in the Achin district of Nangarhar Province as part of a counter terrorism mission going after the ISIS branch in Afghanistan.
An investigation into the incident is underway, the Department of Defense said.
"Despite this tragic event, we remain committed to defeating the terrorists of the Islamic State ... and helping our Afghan partners defend their nation," Nicholson said in the statement.
At a briefing with reporters at the Pentagon, Pentagon Press Secretary Peter Cook said Defense Secretary Ashton Carter had spoken with Nicholson about the attack, and added there was no indication the US service member had been specifically targeted.
Earlier this year, the Pentagon granted new legal authority to allow US forces in Afghanistan to go after ISIS elements inside the country.
Essentially, the change allowed for US forces to pursue ISIS elements and attack them as a threat to America. Previous rules of engagement required ISIS elements to first pose a threat to US forces in the area or to be pursued as part of a specific counter-terrorism mission, officials said.
"This is an effort to try and address a threat not only to the Afghan people and the Afghan government but a larger threat to the United States and we'll continue to target and go after ISIL wherever it appears," Cook said, using another acronym for ISIS.
There have been a total 2,381 US deaths in Afghanistan operations since 2001.