Iraqi insurgency (2017-present)

The Iraqi insurgency occurred from 9 December 2017 when the Islamic State, having lost its territorial control to the Iraqi government in the Iraqi Civil War, transitioned into an insurgency with the help of the White Flags and the Iraqi Ba'ath Party. ISIL's 17,000 remaining fighters teamed up with the White Flags' 1,000 fighters and the 80,000 Ba'athist JRTN insurgents to wage war against the 168,000-strong Iraqi Army, the 150,000-strong Iran-backed Shia Popular Mobilization Forces militia, and the 5,000 US and 550 British troops left in the country to assist the Iraqi government.

War
On 9 December 2017, Prime Minister of Iraq Haider al-Abadi proclaimed victory over the Islamic State caliphate after the Iraqi Army, allied Shia paramilitaries, and the Kurdish Peshmerga forces captured IS' last territories in the desert of Anbar Governorate. While Iraqis celebrated the delcaration of victory in the Green Zone of Baghdad on 10 December 2019, the Islamic State's remaining 17,100 fighters in Iraq prepared to transition into an insurgency phase, operating from their desert and rural bases. ISIL came to have a strong presence in Kirkuk, Diyala, Saladin, and Sulaymaniyah governorates, and they also came to have a strong presence in Kirkuk, Hawija, and Tuz Khurmatu. IS fighters moved through local villages and forced locals to provide them with food and intelligence, also entering into mosques and asking for funds to continue the insurgency. By the fall of 2018, ISIL was stronger than it was in 2008 as the "al-Qaeda in Iraq", having a combined 30,000 fighters in Iraq and Syria. While ISIL's fighters were scattered and without territorial control, they were still in a position to make a comeback, as they faced only local defense forces in the villages of northern Iraq and still had considerable numbers.

IS carried out a number of terrorist attacks against the Iraqi government throughout 2018 and 2019, but IS' strength was underestimated; Canada suspended its military aid to the Kurdish Peshmerga after judging them as no longer useful in the fight against IS. On 4 August 2018, Iraqi Ba'ath Party leader Izzat Ibrahim al-Douri issued an online statement calling of Iraqis to continue fighting the government and the Iranian-backed "Safavid" militias; he also praised Saudi Arabia and called on them to fight against Iran's influence in the country.

On 4 October 2018, the Iraqi military and the Coalition nations of France and the United States initiated an operation to sweep through Anbar Governorate near the city of al-Qa'im and the Syrian border, where IS continued to remain strong and have a large presence. While the fighting in Anbar continued, IS fighters in Kirkuk planted IEDs and carried out ambushes and raids on Iraqi outposts, and the group executed alleged government collaborators. Turkey pledged $5 billion in military aid for the Iraqi government, while US soldiers began training in anti-drone warfare, fearing that the IS fighters would employ drones in their attacks. On 10 September 2019, the US bombed an IS staging area and transit and operations hub on Qanus Island on the Tigris River south of Mosul, dropping over 80,000 pounds of laser-guided bombs and heavily cratering the island.