When ISIS fighters blew up Mosul's grand mosque in June, where its leader famously proclaimed the creation of a caliphate, the move was seen as an act of desperation by a group on its last legs.

Indeed, Iraqi officials were quick to declare their battle against the self-proclaimed Islamic State is over, with the country's prime minister Haider al-Abadi writing on Twitter, "We are seeing the end of the fake Daesh state," using the Arabic acronym for ISIS.

Still, that prediction seems a bit premature, as Iraqi security forces continue to fight the jihadists in the narrow streets and alleyways of Mosul's old city, where the black ISIS flag flew from the now destroyed al-Nuri mosque.

ISIS is 'clearly defeated'

But most analysts who study ISIS think the militants' run in Iraq is close to over, three years after storming into Mosul and taking control of the country's second largest city.

"I think ISIS is clearly defeated, not only militarily but also psychologically and propagandisticly," said Ely Karmon, a senior research scholar at the Institute for Counter-Terrorism at Israel's Interdisciplinary Centre.

"We see that their propaganda material, which was quite sophisticated, is less and less disseminated. We don't hear the leaders of ISIS on audio or video," Karmon told CBC News. "They are in retreat."

A photo believed to be the leader of ISIS, Abu Bakr al-Baghdadi, was taken from a video posted by the group as Baghdadi proclaimed his Islamic caliphate at the al-Nuri mosque in Mosul in June 2014. (Reuters)

The fate of the leader of ISIS, Abu Bakr al-Baghdadi, remains unclear. Russia has twice said it is certain he was killed in Russian airstrikes in Syria in May, but no evidence of his death has been made public.

The military campaign to retake Mosul began just over eight months ago and involved thousands of Iraqi soldiers and police officers, as well as members of Iranian-backed militias and Kurdish troops.

Swaths of the city are destroyed

Their predicted victory will be bittersweet.

Large swaths of the city have been destroyed by the military offensive, and hundreds of thousands of civilians have fled their homes, with many still living in cramped and squalid conditions in the many camps for displaced people outside of Mosul.

The battle for Mosul has sent tens of thousands of residents fleeing their homes. Those who try to return find basic services such as water and electricity unavailable. (Alaa Al-Marjani/Reuters)

The U.S.-led coalition fighting ISIS reports that two million people have returned to their homes throughout Iraq. But many came back to find houses in ruins with no access to basic services, such as running water and electricity.

Still, there is a sense of elation in Mosul that three years of living under stifling rules imposed by ISIS, sometimes with the threat of the punishment of death if broken, are soon to be history.

When Mosul is fully under the control of the Iraqi authorities again, it will perhaps offer the most tangible proof of how the ISIS caliphate continues to crumble.

ISIS territory and revenues shrink

A recent report from IHS Markit Conflict Monitor shows at the height of its power in early 2015, the militants controlled 90,800 square kilometres of territory in Syria and Iraq. Now, IHS estimates that the land under its control has shrunk by more than 60 per cent to 36,200 square kilometres.

The analysis also found ISIS in severe financial trouble, with monthly revenues down to $16 million in the second quarter of this year, compared to $81 million in the the same period of 2015.

ISIS relied on high rates of taxation and fines levied against those under its rule. But much of the money it brought in came from oil sales, and those revenues are down by 88 per cent, according to IHS.

"The Islamic State's rise and fall has been characterized by rapid inflation, followed by steady decline," said Columb Strack, senior Middle East analyst at IHS Markit. "Three years after the 'caliphate' was declared, it is evident that the group's governance project has failed."

ISIS is also under pressure in Raqqa, the Syrian city where Kurdish and Arab forces are fighting against the militants. (Goran Tomasevic/Reuters)

ISIS is also under heavy pressure in Syria, where American-backed Kurdish and Syrian forces continue to battle for control of Raqqa, the group's de facto capital in the north of the country.

There are reports that the militants are stepping up suicide bombings and other attacks on civilians as ISIS comes under pressure.

ISIS has lost many of its fighters to the campaign of heavy airstrikes launched by the U.S.-led coalition fighting the militants. In both Mosul and Raqqa, the coalition has been criticized for what monitoring groups say are high levels of civilian deaths caused by the strikes.

Beleaguered Iraq faces many issues

While the demise of ISIS in Syria and Iraq will be greeted by celebrations by many, Israeli counter-terrorism analyst Karmon says stability will remain elusive in the months and years ahead.

"The end of ISIS in Mosul does not end the strategic problems of the region," Karmon said.

Ely Karmon, a senior research scholar at the Institute for Counter-Terrorism at Israel’s Interdisciplinary Centre, says the end of ISIS does not mean the end of strategic problems in Iraq. (Courtesy IDC)

He points to Shia militias, backed by Iran, who are trying to establish a territorial foothold north of Mosul, which has many Sunni Muslim worried about possible "revenge attacks" as scores are settled. Iraqi Kurds are expected to use their recent military successes to push for independence in an upcoming referendum.

There are also worries, according to Karmon, of ISIS fighters regrouping.

"They will try to… build a clandestine underground network to continue the fight," Karmon said. "We have people who will try to leave Iraq and Syria and go to other unstable regions like Yemen, for instance."

'There's no good plan'

The battle for Mosul has now focused attention in recent days on the fact there is largely no clear vision for life after ISIS in Iraq.

"There's no good plan," said Bessma Momani, a professor at the Balsillie School of International Affairs at the University of Waterloo.

"There is still — like it or not — a deep… distrust of the Iraqi central government," in Mosul, she told CBC news earlier this year.

"They need to do a lot to get things back on track: electricity, water, all of that is in shambles. The health care system has been almost destroyed. All of that requires money. And the central government doesn't have it."