With the Islamic State group's "caliphate" seemingly nearing its downfall in Iraq, the country's security agencies are preparing for a different fight against the militants, shifting away from ground offensives to a focus on intelligence work, surgical airstrikes and a higher level of cooperation with the West.
The new strategy is designed to counter an expected move by the Islamic State group away from holding territory and back to a more classic role as a dispersed, underground terror organization after it loses Mosul, its last major urban center in Iraq.
Already, the militants are laying the groundwork for a strategy of hiding in remote areas, carrying out attacks in Iraq and abroad and resorting to organized crime to bankroll operations, intelligence and counterterrorism officials said.
The immediate priority for Iraqi officials is to limit the number of militants who escape Mosul to go into hiding, they said. Longer term, they said, the fight against post-Mosul IS can only succeed if the border with Syria is secured and the Shiite-led government in Baghdad addresses longtime grievances by Iraq's Sunni Arab minority that fueled support for the militants.
Six officials — four from intelligence agencies and two from the Interior Ministry's counterterrorism agency — described the planning in interviews with The Associated Press. They spoke on condition of anonymity to discuss the agencies' preparations.
"Tough days await our intelligence and security agencies when they start fighting a different Islamic State," predicted Hisham al-Hashimi, an Iraqi security analyst.
U.S. Defense Secretary Ash Carter said last weekend that U.S. and international forces will need to keep a presence in Iraq even after IS's fall "to make sure that, once defeated, ISIL stays defeated."
"We'll need to continue to counter foreign fighters trying to escape and ISIL's attempts to relocate or reinvent itself," he said, using an alternative acronym for the Islamic State group.
It could still take weeks for Iraqi forces to fully retake the northern city of Mosul. But if the city falls, IS territory in Iraq that once stretched across a third of the country would be reduced to small pockets in the north and west that the military will likely be able to mop up relatively quickly. The group, however, will still have a cohesive, if eroding, stretch of territory in neighboring Syria.
Iraq is negotiating with several Western companies to buy surveillance equipment to monitor the long desert border with Syria, the officials said.
The equipment would beef up surveillance by Iraqi drones, they said. There are also plans to deploy units from the mainly Shiite state-sanctioned militias to help the army in patrolling the border, the officials said.
Iraq also wants to intervene against IS in Syria to ensure the group's de facto capital there, Raqqa, is retaken, a senior counterterrorism official said. Syrian Kurdish-led forces, backed by U.S. airstrikes, launched an offensive aimed at encircling Raqqa a month ago, but have made no significant advances on the ground.
The counterterrorism official said Damascus had quietly given permission for Iraq to carry out airstrikes by drone or warplanes in Raqqa. There was no way to confirm the plan with Syrian officials. The Syrian and Iraqi governments are both allied to Iran, and Iraqi Shiite militiamen have been fighting in Syria alongside the forces of President Bashar Assad.
To curtail the impact on the West from a decentralized IS, the officials said Iraq has stepped up existing coordination and exchange of information with authorities in Western Europe, the United States and Australia. The intention is to prevent attacks by sleeper cells and stop Western militants from returning home.
The counterterrorism agency had wanted the Mosul offensive to be delayed to give time to degrade IS before the full-fledged assault caused them to flee and disperse, the officials said.
"We had wanted them to stay put in Mosul, clustered together there while we hit them day after day with targeted airstrikes and intelligence operations," the senior counterterrorism officer said.
Instead, most senior and middle ranking IS operatives left Mosul after the offensive began in October, slipping into Syria, Turkey and Iraq's Kurdish region, the officials said. The group's top leader Abu Bakr al-Baghdadi is among those who fled, and he is now believed to be in northwestern Iraq near the border or in Syria, they said.
They estimated that IS had between 4,500 and 6,000 men fighting in Mosul, including members with administrative posts or serving in the "hesbah" — a sort of religious police — who were ordered to join the defense of the city.
But dozens of the group's Iraqi fighters have left with their families among the civilians fleeing the fighting, possibly with permission from local IS leaders, he said. The concern is that everyone who gets out will eventually be put in IS cells plotting future attacks.
"If 1,000 militants escape, and that's very possible since there are still escape routes open, that will be enough to terrorize not just Iraq, but the whole region," the counterterrorism official said.
The officials said the agencies have been gleaning information on IS's post-Mosul plans from informants and interrogations of captured fighters.
After Mosul, IS plans to abandon military-style formations and instead operate in cells of up to 50 fighters, the officials said. The cells would plot attacks on civilian targets, government complexes, military installations or prisons to free jailed IS members.
"The plan for what happens after Mosul is thorough, complete with a list of places to hide and how to secure supplies of food, water and fuel," said the counterterrorism official. He cited remote desert and rocky gorges in western and northwestern Iraq close to the Saudi and Syrian borders as likely refuges.
A glimpse of what could be in store came in October when IS fighters and suicide bombers, believed to come from sleeper cells, attacked the oil city of Kirkuk, killing at least 80 people. Last month, a suicide car bomber hit Shiite pilgrims returning from a major religious observance, killing 92.
"The residual of this organization is going to be very lethal, very dangerous," Prime Minister Haider al-Abadi warned in Nov. 28 interview with the AP. "The unfortunate thing is that we have to be very successful every time. They only have to be successful one time to introduce havoc somewhere in the world."
Post-Mosul restructuring will not be trouble-free for IS, the officials said. It has already seen a notable decline in new recruits. It will lose the territorial depth that provided a population from which to draw fighters and wide space to freely operate, whether rigging explosives for suicide attacks or developing chemical weapons.
It will also lose significant financial resources, including taxes it collected from Iraqis under its rule. It will likely increasingly fall back on other methods like kidnapping for ransom and running protection rackets, the officials said.
The group's track record of brutality while in power has also reduced the sympathy they once enjoyed among some Iraqi Sunnis. But whether that trend continues depends on whether the Shiite-led government takes concrete action to bridge the Sunni-Shiite rift, the officials said.
IS has shown itself to be tenacious and resourceful.
Its forerunner, al-Qaida in Iraq, survived near destruction during the U.S. troop surge of 2007 and 2008. The militants retreated to remote parts of Iraq to regroup. In the meantime, government actions stoked Sunni resentment of Shiite domination, and the extremists in their new incarnation burst again onto the scene in 2013 and 2014, seizing large swaths of Syria and Iraq.
Michael W. Hanna, a Middle East expert with New York's Century Foundation and a longtime Iraq watcher, said IS has honed its survival tactics.
"ISIS in Iraq is an old organization and it is prepared to go back to the desert, back to being both an insurgency and a terrorist group," said Hanna, using one of several acronyms for the group.