For a time, the caliphate really did exist: a terrifying medieval prophecy sprung to life and captured in the pitiless freeze-frames of propaganda videos. Even as U.S.-led forces in Iraq and Syria deal decisive blows to Islamic State, the group remains a potent threat.
In 2014, ensconced amid the looted bank vaults of Mosul and on the killing fields of Raqqah, Islamic State was at the apex of its strength. From its twin bases in Iraq and Syria, it subjugated millions, dispatched operatives to strike the capitals of Europe, bestrode the cyberspace battlefield, and beheaded captive Americans and other foreigners whom the world's mightiest militaries were powerless to pluck to safety.
Now an all-but-stateless Islamic State — largely driven from Mosul, and besieged in its self-declared capital, Raqqah — might seem poised for oblivion.
But longtime observers warn that the group's virulent ideology is still very much alive, along with its ability to threaten both the immediate region and the wider world.
"It's on its way to losing the caliphate, but that's not the end of the story," said Hassan Hassan, a fellow with the Washington-based Tahrir Institute, who has written widely about the group. "It's a different story now, with a different plot."
In May of last year, as U.S.-backed forces were seizing large chunks of Islamic State's territory, the group's then-spokesman, Abu Mohammad Adnani — who would die a few months later in a fiery U.S. airstrike — shrugged off these losses as part of a divine plan that would leave the group ultimately victorious.
"Do you think, America, that defeat is the loss of a city or land?" he asked mockingly. "Defeat is to lose the will to fight... and you will only win, America, if you rip the Koran from our hearts."
Swaths of Mosul's storied Old City are now a denuded landscape. Railings and signs dangle from buildings reduced to crumbled masonry. Surviving civilians, still terrified, welcome coalition soldiers as liberators, but gesture — numbly yet insistently — toward ruins under which loved ones lie buried.
In the few structures still standing, remnants of Islamic State's rule still can be seen. Here, a scatter of charred religious pamphlets, one with a special prayer for patients healing from wounds and injuries. There, an explosives belt with its detonator parts scattered. On a battered wall, a smear of graffiti with a signature Islamic State slogan: "Baqiyah wa tatamadad" or "Enduring and Expanding."
That would seem a tall order for the group at this juncture, but Islamic State has made resilience its trademark.
Even before Iraqi Prime Minister Haider Abbadi traveled to Mosul this week to proclaim victory in the fight to retake the city, the group already was reverting to its roots as an insurgency, melting into desert hinterlands on the Syria-Iraq border, launching hundreds of attacks from areas that had been deemed primarily pacified.
"They've got a playbook for this that they've used before," said William McCants, a senior fellow at the Brookings Institution and the author of a recent book about the group. "They go to ground. In territory they don't control, they try to blend in. They carry out assassinations and terror attacks, and prepare for a comeback."
The Combating Terrorism Center at West Point in a report last month found that Islamic State as of April had launched 1,468 attacks in 16 cities that had been "liberated" from its control, resulting in nearly 2,600 deaths.
The largest number was in West Mosul, which saw 130 attacks in the 30 days that followed that part of the city's recapture from Islamic State.
A recent case in point is the eastern Syrian town of Mansoura, about 50 miles from Raqqah, among the areas freed by coalition forces. Displaced families from areas still controlled by Islamic State have swelled its original population of about 12,000 to more than four times that. On street corners and the walls of former government buildings, the group's telltale black-and-white signs have yet to be painted over.
A local leader of the Kurdish forces known as the People's Protection Units, or YPG, acknowledged that many in the town still live in fear of the militants. Women still wear black full-body gowns, with heads and faces covered.
"We need people to trust us and manage themselves," said the Kurdish leader, Zinar Kobani, who created a post for his unit in the home of a former Islamic State leader, incongruously fitted out with crystal chandeliers and a marble fireplace. "They are still afraid. It takes time to trust and to be free."
Days ago, he said, Kurdish forces unmasked a suspected militant disguised as a woman, mixing with shoppers at a market. The suspect, whom they believed was spying or plotting an attack, was handed over to military intelligence officials.
Kurdish soldiers were still sniffing out militant tunnels under the town and fighting off attacks outside it. Recently, they caught an 11-year-old boy who had fought for Islamic State — a so-called "cub of the caliphate" — and released him to his family.
The caliphate may have lost its caliph; this week brought a new flurry of speculation about the fate of the group's chieftain, Abu Bakr Baghdadi. The American general who heads the coalition confronting Islamic State, Lt. Gen. Stephen Townsend, said this week he had no idea whether the latest reports of Baghdadi's death were true.
"I don't have a clue," Townsend told reporters in a video call from Baghdad. "Hope he's deader than a doornail — and if he's not, as soon as we find out where he is, he will be."
But even if those reports are borne out, the group can in all likelihood reconstitute its leadership, analysts believe. Islamic State has also shown its ability to withstand the loss of enormous numbers of foot soldiers in recent fighting.
"As an organization, as an organism, it's still intact, in my opinion, despite the killing of very important leaders," said Hassan. "Ideologically, the appeal persists. And the grievances it exploited are not yet addressed. Sectarianism, extremism — all the ingredients of 2014 are still there."
In eastern Syria, militants have continued to harry the strategically located city of Shaddadi, on the road connecting Raqqah and Mosul. Its seizure in February by U.S.-backed ground forces, aided by coalition airstrikes, was considered a major victory against the militants because it severed their connection to Mosul and provided a bulwark against attacks on Kurdish-held areas to the north.
But the supposedly vanquished militants simply changed tactics. A local YPG commander said the Islamic State fighters are employing small-scale strikes, sometimes using explosives-laden vehicles, while avoiding direct large-scale confrontation.
"Now they are not attacking the front line," the commander, Daman Frat, said over tea at his command post in Shaddadi, whose surrounding governorate is home to more than 1.5 million people.
Even maintaining the status quo against the militants is a drain on the coalition's military manpower. The YPG still has about a thousand troops in Shaddadi, Frat said, countering a remaining Islamic State presence in the area of at least 500 fighters. An attack last month left five Kurdish soldiers dead, he said.
And Islamic State maintains a degree of free movement even in liberated areas. South of Shaddadi, another Kurdish commander pointed from his unit's outpost to what he said were militants moving among villages, traveling by motorcycle.
Over the past three years, Islamic State has been "very well entrenched, and a number of local tribes have been complicit, and that will continue," said McCants, the Brookings analyst.
"Look at their main slogan, 'enduring.' They coined that at a time when they were suffering heavy losses and recovered, so they can point back to that time," he said.
In Mansoura, a local leader named Sheikh Fawaz Beik helped negotiate a cease-fire and the withdrawal of Islamic State militants from the town in May. Last week, the sheikh was recovering from injuries from a remote-controlled bomb blamed on remnant fighters from Islamic State.
He described the determination of "Daesh" — an Arabic acronym the group considers pejorative — to cling to its emblems at any cost.
On the day of the cease-fire, he recounted, the fighters were asked to display green Islamic flags rather than their own black banners as part of their exodus from the town. They heatedly refused, and amid the ensuing quarrel, one of the group's fighters detonated a car bomb, setting off a firefight that left some 30 of the militants dead.
"They would not accept it," the sheikh recalled. "They said, 'There is only one flag in the world: the Daesh flag.'"
Special correspondent Bulos reported from Mosul, Iraq, staff writer King from Washington and staff writer Hennessy-Fiske from Mansoura and Shaddadi, Syria. Special correspondent Kamiran Sadoun contributed reporting from Mansoura and Shaddadi.