It is also premature to assert that the Islamic State is running out of territory. While its footprint has shrunk in Iraq and Syria, it still controls close to 4,000 square miles along the Euphrates River Valley on both sides of the Iraq-Syria border. American and Iraqi military commanders believe the group’s core leaders have gone to ground in the largely barren areas along the border.

At the same time, ISIS branches in North Africa and Asia are still launching operations, and its camps in eastern Afghanistan remain largely intact, despite recent American airstrikes.

Some areas that were previously declared liberated have seen a return of ISIS fighters. In Libya, where the group was routed from a 100-mile stretch of coastline in late 2016, the militants recently posted a video showing their fighters manning a new checkpoint. And far from its roots in the Middle East, the group continues to grow in other corners of the world, including in the Philippines, where a local affiliate held the town of Marawi for months, and in West Africa, where the militants continue to grow their ranks, encroaching on areas formerly under Al Qaeda’s grasp.

If the Islamic State does decline, other jihadist organizations are poised to fill the vacuum.

Al Qaeda, whose appeal to young fighters had been largely eclipsed by the tech-savvy new caliphate of the Islamic State, is vying for a comeback.

“The reason that the I.S. gained a big following quickly was that it appealed to the hotheads, those looking for instant gratification,” said Bill Roggio, a senior fellow at the Foundation for the Defense of Democracies who monitors terrorist groups. “That caliphate model is all gone, but Al Qaeda remains.”

The older group has been urging followers to pivot from the Islamic State’s focus on the battlefields of the Middle East and instead put an emphasis on attacks in the United States and other foreign lands.

It has also been promoting a younger, charismatic new leader: Hamza bin Laden, 27, the son of Osama.