The future of Iraq hangs on how the ongoing struggle in Mosul pans out. It is very clear that the Iraqi forces will eventually win the day, and Daesh (the self-proclaimed Islamic State of Iraq and the Levant) will be eliminated as a territorial force in the country. This important victory has been far too long in the coming, but at least it is now a foreseeable outcome. But what comes afterwards is on what Iraq’s future depends.

The restored authority of the national government, and its representatives in Mosul, will need to reach out to a shattered population and former adversaries to try to rebuild a mutually agreed national consensus on how the state should run. Many of those who supported the Daesh regime were Iraqis who felt betrayed by a sectarian government in Baghdad and saw little future for themselves in a state that excluded them.

The Iraqi government needs to make sure that its security forces, as well as the future political leaders yet to reclaim office in the north of the country, do not make the same mistakes again and replicate the crisis yet again. This is hard when some of the forces fighting around Mosul are Iranian-backed militias.

But before a new political calm can arrive, the bitter struggle has to finish. The battle for the old city of Mosul is being fought out in narrow alleyways and confusing buildings that have built up in random fashion over hundreds of years. Some rooms will extend over other people’s houses, and some courtyards will on other people’s roofs. In this difficult urban territory it is necessary to fight face to face, using only light and medium weapons, unable to use the air power that is available because of the presence of the 100,000 civilians that are being exploited by Daesh fighters as human shields.

Even worse, when a Daesh fighter feels that he is about to fail, he can slip off his battle fatigues, put on civilian clothes and mingle with the civilians. The Iraqi forces know that such infiltrators may slip away to create mayhem elsewhere, or they might stay in Mosul in order to kill Iraqi soldiers in sneak assassinations that will stoke fear and tension for the foreseeable future, upon which Daesh will thrive.

It will be exceptionally hard to rebuild an inclusive society in such an atmosphere of tension and terror, but such a task is absolutely necessary for the future of Iraq.