It was an awkward coalition riven by political and sectarian differences, facing an elusive, fanatical enemy dug into an urban maze of narrow streets and alleyways. So, could Iraq's government really deliver on its vow to vanquish Islamic State?
In the end, the army, Shi'ite Muslim paramilitaries and Kurdish Peshmerga fighters mustered rare unity to end Islamic State's reign of terror in Iraq's second city Mosul, seat of the ultra-hardline Sunni insurgents' "caliphate".
15 May 2017. Mosul, Iraq. Reuters/Danish Siddiqui
Members of the Iraqi Counter Terrorism Service forces look at the positions of Islamic State militants during clashes in western Mosul.
27 Jun 2017. Mosul, Iraq. Reuters/Alaa Al-Marjani
A member of Iraqi Federal Police crosses from one house to another through a hole in the wall at the frontline in the Old City of Mosul.
1 Mar 2017. Mosul, Iraq. Reuters/Goran Tomasevic
A woman gestures as she approaches Iraqi Special Forces soldiers during a battle in Mosul.
28 Jun 2017. Mosul, Iraq. Reuters/Ahmed Jadallah
A member of the Iraqi Federal Police rests at the frontline in the Old City of Mosul.
12 Mar 2017. Mosul, Iraq. Reuters/Zohra Bensemra
Iraqi Federal Police and a man carry a civilian, injured while opening a booby-trapped shop in Tayaran district, as Iraqi forces battle with Islamic State fighters in western Mosul.
14 Aug 2017. Raqqa, Syria. Reuters/Zohra Bensemra
A member of the Syrian Democratic Forces calls his comrades during the fighting with Islamic State fighters in Raqqa.
16 Jun 2017. Raqqa, Syria. Reuters/Goran Tomasevic
Kurdish fighters from the People's Protection Units fire rifles at a drone operated by Islamic State militants in Raqqa.
17 Oct 2017. Raqqa, Syria. Reuters/Erik De Castro
A civilian prays after she was rescued by fighters of Syrian Democratic Forces from the stadium after Raqqa was liberated from the Islamic State militants in Raqqa.