The deaths of four Americans in a suicide attack in Syria this week has intensified the military’s concern that the Islamic State may step up attacks on U.S. forces to score a propaganda victory as the Trump administration withdraws.

Military officials have begun an investigation into Wednesday’s assault in the northern city of Manbij, which killed two U.S. service members, a Pentagon civilian and an American contractor. Five Syrians also died when a bomber detonated explosives in a restaurant where the U.S. personnel were meeting with allies, local officials said.

Current and former officials from the military and other U.S. agencies voiced concern Thursday that militants could launch similar assaults as the Pentagon executes President Trump’s order to depart in coming months. Military officials said they believe the Islamic State conducted the attack.

Security camera footage shows the moment of the Jan. 16 explosion in Manbij, Syria. Four Americans were killed in the attack claimed by the Islamic State. (Associated Press)

“We are certainly aware that as we constrict and destroy the last remnants of the caliphate that ISIS has moved toward an insurgency,” one official said, using an alternative name for the Islamic State. “As that insurgency develops, we’ll be a prime target for that as we withdraw. Everyone’s aware of that, and it’s part of our planning.” The official spoke on the condition of anonymity to provide insight about what remains a sensitive military operation.

Wednesday’s attack, the most deadly combat incident in Syria since U.S. forces arrived in 2015, came nearly a month after the president declared victory against the Islamic State and announced that the U.S. force of about 2,000 troops would make a swift exit. Speaking at the Pentagon on Thursday, Trump offered his condolences to the families of those killed in Manbij. “We will never forget their noble and immortal sacrifice,” he said.

Trump’s unexpected exit order upended plans for an ongoing Syria mission and sent military forces scrambling to draft a plan to end its mission quickly.

Analysts said the Islamic State, which has been driven from most of the vast area it controlled at its peak in 2014, appears to sense an opportunity.

U.S. warplanes continue to conduct airstrikes in support of Syrian Kurdish forces battling remaining militant forces in far eastern Syria, a fight that has taken longer than many officials expected. The group also retains the ability to conduct guerrilla attacks across Syria, aided by a network of sleeper cells.

Charles Lister, a senior fellow at the Middle East Institute, said the Islamic State had embraced a tactic it used in previous years, in which a portion of its fighting force put down their arms and returned at least temporarily to civilian life.

“This kind of almost silence was to be expected,” Lister said. “Now, ISIS does have an opportunity to prove it is still there and humiliate the U.S. as it withdraws. There will be more bombings like this to send a message that ‘Yes, America says it has defeated us, but we’re still around.’ ”

Kenneth M. Pollack, a scholar at the Brookings Institution, said the group has a “strategic motive” for showing its ability to strike the United States at this moment.

“If they can claim credit for having driven the U.S. out of Syria or having accelerated the U.S. departure, that could really help them with their recruiting and support,” he said.

The U.S. ground mission in Syria has been characterized by a light footprint and relatively few casualties — a sign of the nature of the mission, which has been mostly to support local forces as they do the front-line fighting. Before Wednesday’s attack, two American service members had died due to enemy attacks in Syria since 2015.

The stabilization mission in Manbij, which followed the Islamic State’s expulsion in 2016, has been relatively quiet. Favorable security in the city, a potential flash point in a rivalry between U.S.-backed Syrian Kurds and NATO ally Turkey, has allowed Americans to move more freely — and more visibly — than they do in other places.

Military officials have said a tight timeline to exit will require the relatively small force to focus primarily on the drawdown and force protection, meaning the troops will be able to provide only waning support to Syrian forces battling the Islamic State.

Privately, some officials have voiced concern about the White House plan to turn the battle against militants over to Turkish-backed troops in Syria, whom the officials view as unreliable and ineffective.

The Pentagon has already begun to remove some nonlethal equipment from a constellation of bases in Syria, but no troops have yet departed. In an indication the drawdown is in its initial stages, that cargo so far has been ferried via previously scheduled flights and ground movements. No bases have been shuttered.

Weeks after Trump made his initial announcement, widespread uncertainty remains about how the administration will proceed in its drawdown plan. Senior officials, including Trump’s national security adviser and his secretary of state, had previously touted a plan to remain in Syria until Iranian-backed forces depart. Iran and Russia are chief backers of Syrian President Bashar al-Assad.

Those officials have continued to back the president but at times have suggested that the departure may be altered or slowed to account for the ongoing battle in eastern Syria, as did Vice President Pence on Thursday.

“Their families and our armed forces should know their sacrifice will only steel our resolve, that as we begin to bring our troops home, we will do so in a way that ensures that the remnants of ISIS will never be able to reestablish their evil and murderous caliphate,” Pence said at a Pentagon event related to missile defense.

Lawmakers from both parties have linked the bloodshed in Manbij to their doubts about Trump’s desire to halt the Syria mission.

“This horrific attack reminds us that ISIS has not been defeated, and I’m deeply concerned that the administration’s announced withdrawal may embolden what remains of that dangerous organization,” Rep. Eliot L. Engel (D-N.Y.), head of the House Foreign Affairs Committee, said in a statement.

Five local residents also were killed in the attack, according to the Syrian Democratic Forces (SDF), the Kurdish-dominated force that has been the Pentagon’s chief local partner against the Islamic State.

“ISIS, which is receiving heavy blows and is on the verge of losing all the ground it holds, is trying to spread chaos and fear in the areas that has been liberated by our forces with the help of some parties that are aiming to disrupt peace and stability in the region,” the SDF said in a statement.

Liz Sly in Beirut and Josh Dawsey and Karen DeYoung in Washington contributed to this report.