WASHINGTON — An American service member died in Afghanistan on Wednesday after being wounded in an operation against the Islamic State’s affiliate in the country, the military said.

American and Afghan troops were also injured in the raid, which took place in eastern Afghanistan. American military spokesmen did not disclose how many were hurt or provide details about their mission.

Even as the United States has sought to help Afghan forces push back the Taliban, it has been involved in a separate fight with the Islamic State in Khorasan Province, as the affiliate is known.

In April, the United States dropped a massive conventional bomb on the extremists, the so-called mother of all bombs. The United States has repeatedly carried out drone attacks to kill the group’s leaders.