“We’ve expected that as the physical caliphate went away, the remnants of this would attempt to revive themselves and revive their networks, and take on these insurgent, guerrilla-like tactics,” Gen. Joseph L. Votel, the head of the military’s Central Command, said in an interview in Bahrain last week.

“We’re well prepared for that,” said General Votel, who oversees the American military in the Middle East and Southwest Asia. “These organizations never go away in one fell swoop.”

The number of foreign terrorist fighters, once pouring into Iraq and Syria at about 1,500 a month, has dropped sharply. But the Islamic State still attracts about 100 new foreign fighters to the region each month, Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, told a meeting of military chiefs in October.

“On its current trajectory, ISIS could regain sufficient strength to mount a renewed insurgency that once again threatens to overmatch local security forces in both Iraq and Syria,” the Institute for the Study of War in Washington concluded in a recent analysis.

In Iraq, Islamic State sleeper cells in recent months have carried out raids and ambushes against Iraqi security forces and civilians, particularly in Anbar, Kirkuk and Salahuddin provinces.

And as the Islamic State hunkers down in Syria, including in caves and fortified tunnels in Hajin and a few surrounding villages in the Euphrates River Valley, it wields a diminished but still formidable social media prowess to rally its followers on the ground and on the internet.

“It is displaying its wins on its official online channels, including the alleged capture of enemy fighters and the killing and wounding of many others,” said Laith Alkhouri, a senior director at Flashpoint, a business risk intelligence company in New York that assesses the global terrorist threat.