Intelligence and local officials said that, a few months ago, they noticed a growing stream of commanders and fighters flowing out of the city to the Hamrin mountains in northeast Iraq which offer hideouts and access to four Iraqi provinces.
Some were intercepted but many evaded security forces and began setting up bases for their new operations.
What comes next may be a more complex and daunting challenge for Iraqi security forces once they finish celebrating a hard-won victory in Mosul, the militants' biggest stronghold.
Intelligence and security officials are bracing for the kind of devastating insurgency al Qaeda waged following the 2003 US-led invasion, pushing Iraq into a sectarian civil war which peaked in 2006-2007.
"They are digging in. They have easy access to the capital," Lahur Talabany, a top Kurdish counter-terrorism official, told Reuters. As part of the US-led coalition, he is at the forefront of efforts to eliminate Islamic State.
"I believe we have tougher days coming."
Some Iraqi Islamic State fighters have roots dating back to al Qaeda's campaign of car and suicide bombs that exploded by the dozens each day and succeeded in fueling a sectarian bloodbath in Iraq, a major oil producer and key US ally.
When a US-funded tribal initiative crushed al-Qaeda, the hardcore regrouped in the desert between Iraq and Syria. They reappeared with a new jihadist brand that took the world by surprise: Islamic State.
Shortly after its lighting sweep through Mosul, the group outdid al Qaeda's brutality, carrying out mass beheadings and executions as it imposed its ultra-hardline ideology.
Unlike al-Qaida, it seized a third of Iraqi territory, gaining knowledge of land that could come in handy as it hits back at Iraqi security forces.
Saddam's intelligence agents
Former Iraq intelligence officers who served under Saddam Hussein joined forces with Islamic State in an alliance of convenience. These shrewd military strategists from his Baath Party are expected to be the new generation of Islamic State leaders, Talabany and other security officials said.
Instead of trying to create a caliphate, a concept which attracted recruits from disaffected fellow Sunni Muslims, Islamic State leaders will focus on far less predictable guerrilla warfare, Iraqi and Kurdish security officials said.
Iraqi forces have come a long way since they collapsed in the face of the Islamic State advance in 2014, throwing down their weapons and removing their military uniforms in panic.
They fought for nearly nine months to seize Mosul, with steady help from US-led airstrikes that flattened entire neighbourhood.
The key question is whether an army that is far more comfortable with conventional warfare can take on an insurgency with sleeper cells and small units of militants who pop out of deserts and mountains, carry out attacks and melt away.
"They'll try to hide with the population. Their cells will get smaller - instead of companies and platoons, they'll go to squads and cells, much smaller elements hiding in the population," Lieutenant-General Steve Townsend, commander of the US-led coalition, told reporters.
"Our Iraqi security force partners will have to engage in counter-insurgency style operations at some point and we're already making efforts now to start shaping their training towards that next ISIS tactic."
History suggests training may not be enough.
The United States spent $25 billion on the Iraqi military during the American occupation that toppled Saddam Hussein in 2003 and triggered an insurgency that included al Qaeda.
That did not prepare the army for the long-haired Islamic State militants who sped into Mosul in pickup trucks with weapons stolen from retreating Iraqi troops.
Iraqi forces can certainly point to successes in Mosul and the cities of Falluja and Ramadi in Anbar province, once held by Islamic State.
But local officials say the cities remain vulnerable to attacks from the vast desert nearby mastered by militants.
"Security operations will be useless unless security forces control the desert," said Anbar official Emad Dulaimi, adding that the desert had become a safe haven for Islamic State.
"It is not present as an organization in cities but it carries out attacks by individuals. Car bombs. Suicide bombers. People fear Islamic State will come back. There are attacks every day."
Tareq Youssef al-Asal, leader of a tribal force, shares those concerns and complains of what he says is a lack of a coordination among numerous local security forces.
"In the end these leaderships have no experience fighting in the desert," he said.
Some ordinary citizens still do not feel safe despite the Iraqi army's improved performance.
Anbar resident Ahmed al-Issawy does not plan on re-opening his restaurant anytime soon. He is afraid it will be destroyed the same way it was in clashes between security forces and Islamic State in 2014.
Source: Times of India