An American service member was killed Thursday by an improvised explosive device in Syria, a U.S. military official confirmed, marking the second American killed in action there since the United States began backing local forces in a conflict President Trump has vowed to leave.

The attack occurred during an operation against the Islamic State that also left a British service member dead, underscoring the risks the U.S.-led coalition faces across northern and central Syria as it transitions from fighting the militant group to stabilizing areas the group left behind.

The Pentagon declined to release the nationalities and identities of the two service members killed, pending notification to next of kin, but a U.S. military official confirmed that one was American. Britain’s Ministry of Defense said one of its military personnel was killed in Syria in an operation against the Islamic State. Five others were injured.

The deaths occurred about two hours after Trump promised in a speech in Ohio to withdraw the roughly 2,000 U.S. troops in Syria “very soon” and “let the other people take care of it.” 

The president has been agitating for the removal of U.S. troops from Syria, saying it makes little sense for the United States to have so many forces in the country if it has all but won the war against the Islamic State.

A senior administration official said Trump has requested pullout plans and has had conversations with Chief of Staff John F. Kelly and Defense Secretary Jim Mattis about the matter, in which they have offered reassurances that the United States will not have to stay in the country forever.

The president’s advisers have convinced him to stay for now to prevent the Islamic State from reemerging and to lay the groundwork for a potential peace agreement that would be beneficial to the United States, according to people familiar with the discussions, who like others spoke on the condition of anonymity to describe sensitive military discussions. Still, with the help of Russia and Iran, Syrian government forces have been gaining the upper hand in the broader civil war, reducing the likelihood of any such agreement.

Officials had not planned for Trump’s announcement at the rally in Ohio, and it was not clear what prompted him to include the matter in a speech about infrastructure. One administration official described it as “premature” and said it could be a year or longer before such a move happens. Trump was briefed on the deaths of the soldiers after the rally, an administration official said.

The discussions come as the U.S. military faces a crossroad in Syria. The Kurdish-dominated militia that U.S. forces have been supporting has rolled back nearly all of the territory once occupied by Islamic State, helping Washington achieve its primary mission on the ground. The militants are regrouping in a final pocket of eastern Syria. 

Now the militia, the Syrian Democratic Forces (SDF), is trying to prevent the Islamic State from reemerging on the territory as it contends with two more powerful enemies: Turkish troops who view the SDF as a terrorist group, and Syrian government forces backed by Russia and Iran and eyeing its territory for themselves. 

The situation is, in part, the result of a trade-off the U.S. military made when the Obama administration intervened in Syria and Iraq to destroy the Islamic State through a campaign designed to put local proxy forces in the lead rather than American troops.  

The strategy succeeded in limiting U.S. costs and military fatalities, key goals of the Obama administration. While more than 33 American service members were killed in action per month, on average, over the course of the Iraq War from 2003 to 2011, the intervention against the Islamic State has resulted in about one death every three months since it began in 2014. The costs of the operation also have paled in comparison to the years-long U.S. occupation of Iraq. 

The strategy of empowering local forces, however, largely ignored tensions that would inevitably arise in the aftermath between those forces and their enemies, a problem the Trump administration has now inherited.

Thursday’s attack appeared to have taken place in the northern city of Manbij, a former Islamic State stronghold that has become a critical flash point between Turkey and the Kurdish-dominated militia that the United States is backing in Syria. While mutually antagonistic, both are key allies of the United States and now at odds in northern Syria.

In an attempt to calm those tensions, U.S. forces conduct routine patrols in the area. The U.S. military has been holding talks in an attempt to broker an arrangement in the city agreeable to both sides. 

Loveluck reported from Beirut. Dan Lamothe in Kabul and Liz Sly in Beirut contributed to this report.