BEIRUT/WASHINGTON (Reuters) - A bomb attack claimed by Islamic State killed two U.S. troops and two civilians working for the U.S. military in northern Syria on Wednesday, weeks after President Donald Trump said the group had been defeated there and that he would pull out all American forces.

The attack in Manbij appeared to be the deadliest on U.S. forces in Syria since they deployed on the ground there in 2015. The town is controlled by a militia allied to U.S.-backed Kurdish forces.

The U.S. military confirmed four Americans were killed and said three U.S. troops were wounded in the explosion, which an Islamic State-affiliated site said was the work of a suicide bomber.

The Syrian Observatory for Human Rights monitoring group said 19 people had been killed in all, including four Americans.

It was unclear what impact the blast might have on Trump’s calculus after he confounded his own national security team with a surprise decision last month to withdraw all 2,000 U.S. troops from Syria, declaring Islamic State had been defeated there.

No experts believe Islamic State has been defeated, despite the group having lost almost all of the territory it held in 2014 and 2015 after seizing parts of Syria and Iraq and declaring a “caliphate.”

Trump’s Dec. 19 announcement was one of the reasons his defense secretary, Jim Mattis, resigned. It stunned allies and raised fears of a long-threatened Turkish military offensive against U.S.-backed Kurdish forces in northern Syria.

Hours after the blast, U.S. Vice President Mike Pence said he and Trump condemned the attack. He simultaneously restated U.S. plans to withdraw while also saying Washington would never allow Islamic State to re-establish itself - something experts say it will try to do following a U.S. pullout.

“As we begin to bring our troops home, the American people can be assured, for the sake of our soldiers, their families, and our nation, we will never allow the remnants of ISIS to reestablish their evil and murderous caliphate,” Pence said.

Republican Senator Lindsey Graham, often an ally for Trump, said he believed Islamic State had been emboldened by the president’s decision to pull out of Syria and asked him to “look long and hard” at what he wants to do there.

“My concern about the statements made by President Trump is that you’ve set in motion enthusiasm by the enemy we’re fighting,” Graham said during a congressional hearing.

Turkish President Tayyip Erdogan said he did not believe the attack would have an impact on the U.S. decision to withdraw from Syria “because I saw honorable Trump’s determination on this point”.

How, and how quickly, U.S. forces leave has caused ructions in northern Syria, with both Turkey and the Syrian government of President Bashar al-Assad ready to fill the vacuum.

The U.S.-backed YPG militia that is allied to the fighters holding Manbij last month invited Assad into the area around the town to forestall a potential Turkish assault. Syrian army troops entered the area soon after.

A witness in Manbij said Wednesday’s attack had targeted a restaurant where U.S. personnel were meeting members of the militia backed by Washington. The U.S. military’s Central Command said in a statement that the attack happened “while conducting a local engagement in Manbij.”

An Islamic State statement later said a Syrian fighter had detonated his explosive vest on a foreign patrol in Manbij.

Two witnesses described the blast to Reuters.

“An explosion hit near a restaurant, targeting the Americans, and there were some forces from the Manbij Military Council with them,” one said.

The council militia has controlled the town since U.S.-backed Kurdish-led forces took it from Islamic State in 2016. Manbij is near areas held by Russian-backed Syrian government forces and by anti-Assad fighters backed by Turkey.

The council said in a statement that women and children were among civilians killed and offered condolences for the “hero American soldiers” who died.

One of the witnesses said there was a “heavy” presence of military aircraft over Manbij following the blast.

At the Pentagon, acting U.S. Defense Secretary Patrick Shanahan offered his condolences to the families.

Syria’s civil war has killed half a million people, forced more than half the country’s pre-war population from their homes and dragged in global and regional powers. Assad controls most of the country.