The group’s current battlefield losses will not automatically translate into meaningful victories for the coalition.
The Iraqi women who had just fled from an area controlled by the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) were still fearful of the group.
Sheltering behind an earthen berm and a Kurdish Peshmerga-controlled checkpoint not far from where the Iraqi army is fighting ISIL in Qayyara, the women didn’t want their full faces shown, lest ISIL harm their relatives.
“They took my brother and sent him to Mosul because he wanted to flee,” said one woman, in local Arabic. She is one of the almost 3.3 million internally displaced people and refugees who have fled ISIL and other groups to find refuge in Iraq.
As ISIL is slowly being defeated in northern Iraq, it is essential that regional powers focus on these refugees and plan now for the rebuilding of their communities that have been damaged by war or risk a repeat of the tragedies and chaos that had allowed ISIL to emerge in the first place.
Among the largest refugee flows in Iraq are people fleeing into areas controlled by the Kurdistan Regional Government (KRG).
For instance, in April of 2016, the International Organization for Migration estimated that over one million people had left Nineveh province around Mosul to the KRG ( PDF ).
This represents around half the population of the province and includes many of the hundreds of thousands of Assyrian Christians, Yazidis, Shabaks and Kakei minorities that ISIL persecuted.
As the war has continued, more than a million people fled Sunni cities such as Tikrit, Fallujah and Ramadi, which have been recaptured by the Iraqi government and its Shia militia allies.
Estimates show that 80 percent of Ramadi is in ruins after its recapture in 2015 and that residents of cities such as Tikrit and Fallujah fear to return.
To ensure that the liberation of these areas doesn't become another vicious cycle and reproduce a new ISIL, refugees should be received now with increased funding and investment in their future.
Sectarian killings have made many people deeply suspicious of the future. Sunni Arab refugees I met in Erbil claimed their relatives had been kidnapped by militias and they preferred to move to Europe rather than return.
Yazidis said they feared to go back to Sinjar without protection from ISIL. Assyrians claimed that Mosul will never be the same.
In mid-July, I went to the frontlines near Bashiqa and Makhmour, where refugees have been increasingly fleeing ISIL as pressure mounts on its last bastions in Iraq.
The women told stories of being harassed by extremists on the streets when they went to buy tomatoes, and young men being forcibly recruited for war.
These are the dying gasps of an extremist regime, but what it leaves behind is a legacy of destruction and suspicion.
Massive effort needed
The KRG Prime Minister Nechirvan Barzani said in an interview with Voice of America on July 24 that 500,000 new refugees are estimated to be fleeing the fighting. “We are working with Baghdad and looking forward to assistance from the international community.”
The reality on the ground is that basic services are lacking. In Bashiqa, one American medical volunteer has been accompanying Kurdish forces who take in people fleeing.
In Makhmour, there were no international NGOs near the front to meet people, and members of a Sunni anti-ISIL militia named al-Hashd al-Watani were helping the refugees get their bearings.
The US State Department hosted a “pledging conference” on July 20 and received pledges of over $2bn for Iraq.
This amount is not nearly enough for the kinds of programmes that need to be put in place now to secure the future of Iraq’s refugees, and to make sure that the chaos that plagued Iraq after the US invasion will not return in the vacuum left by ISIL.
Regional powers, such as Turkey, the Gulf states and Saudi Arabia, in particular, have a significant interest in securing stability in Iraq, especially in the areas that are being liberated from ISIL.
In addition, they have the regional sensibilities that have been lacking in the US role in places such as Afghanistan and Iraq, where massive amounts of money spent has not translated into impact on the ground.
Plan for the future
Before the rise of ISIL, the Nineveh plains were one of the most diverse and culturally rich places in Iraq. Mosul was a crossroad of civilisations.
The rise of ISIL grew out of resentment against Baghdad and built on a decade of insurgencies by groups like al-Qaeda.
To ensure that the liberation of these areas doesn’t become another vicious cycle and reproduce a new ISIL, refugees should be received now with increased funding and investment in their future. However, the KRG government and Baghdad face an economic crisis.
Reconstruction projects are yet to begin in places such as Sinjar, which was liberated last year, and in Khazir which was liberated in May.
In some cases ISIL tunnels and mines still need removal. It is essential to invest aggressively in clearing the vestiges of the extremist group, listen to what refugees want when they return and reconstruct damaged areas. Plan for the future so as not to repeat the past.
Seth J Frantzman is a Jerusalem-based commentator on Middle East politics and has lectured in American studies at Al-Quds University. He has just returned from fieldwork in the Kurdish region of northern Iraq.
The views expressed in this article are the author’s own and do not necessarily reflect Al Jazeera’s editorial policy.