BEIRUT • The loss of its two largest cities will not spell a final defeat for the Islamic State in Iraq and Syria - also known as ISIS and Daesh - according to analysts and US and Middle Eastern officials.
The group has already shifted back to its roots as an insurgent force, but one that now has an international reach and an ideology that continues to motivate attackers around the world.
Yesterday, Iraqi Prime Minister Haider al-Abadi claimed victory over ISIS in Mosul after nearly nine months of fighting. A coalition force is also fighting to drive ISIS out of its Syrian stronghold of Raqqa.
"These are obviously major blows to ISIS because its state-building project is over, there is no more caliphate, and that will diminish support and recruits," said senior fellow Hassan Hassan at the Tahrir Institute for Middle East Policy in Washington who has co-authored a book on the terror group.
"But ISIS today is an international organisation. Its leadership and its ability to grow back are still there."
ISIS has overshadowed its militant precursors like Al-Qaeda by not just holding territory, but also running cities and their hinterlands for an extended period, winning the group credibility in the militant world and allowing it to build a complex organisation.
So even while its physical hold slips, its surviving cadres - middle managers, weapons technicians, propagandists and other operatives - will invest that experience in the group's future operations.
And even though its hold on crucial urban centres is being shaken, ISIS is in no way homeless yet.
In Iraq, the group still controls Tal Afar, Hawija, other towns and much of Anbar province.
In Syria, most of its top operatives have fled Raqqa in the past six months for other towns still under ISIS control in the Euphrates River valley, said US and Western military and counter-terrorism officials.
Many have moved to Mayadeen, a town 175km south-east of Raqqa near oil facilities and with supply lines through the desert. They have taken with them the group's most important recruiting, financing, propaganda and external operations functions, said US officials.
The caliphate also lives on in the virtual realm, as its operatives and supporters churn out propaganda, bomb manuals, encryption guides and advice on how to kill the largest number of people with trucks.
US officials acknowledged the difficulty of fighting the group online.
"We spend an inordinate amount of time and resources as the United States, but also as our partners, trying to not only defeat ISIS and their control of the physical caliphate, but their virtual space that they own," said US Homeland Security and counter-terrorism adviser Thomas Bossert on ABC's This Week television programme on July 2.
Still, many Syrians and Iraqis whose lives the militants have ravaged are glad to see them chased out, despite worries over the future.
"I am happy that Daesh is dying, but the fear of what might come next is killing this happiness," said Raqqa native Ahmed Abdul-Qadir, who was running an anti-militant media group in Turkey when gunmen he believes belonged to ISIS shot him in the jaw.
"It makes me wish that this whole organisation would vanish and that no one who believes in its doctrine would remain alive," he said.