Four days after Iraqi government forces and allied Kurdish troops began advancing on the city of Mosul, Islamic State militants launched a surprising counterattack about 150 km away. Dozens of fighters besieged the oil-rich city of Kirkuk before dawn on Oct. 21, setting off gunbattles, suicide bombings and sniper attacks.

After two days of fighting, most of the assailants were killed, captured or had blown themselves up. Nearly 100 others were also killed, most of them members of the Kurdish security forces. As the militants went on their rampage throughout Kirkuk, they broadcast a message from the loudspeakers of a local mosque: "Islamic State has taken over."

Kirkuk, which is near some of the richest oil fields in northern Iraq, has been under the control of Kurdish forces for more than two years. The surprise attack by Islamic State showed that even while under siege in Mosul, the group could still sow chaos in parts of Iraq far from its strongholds. The offensive also demonstrated that even if it loses Mosul, Islamic State would go back to its roots as an insurgency entrenched in the rural Sunni Arab regions of Iraq — as its predecessor, al-Qaida in Iraq, did after losing several urban areas under its control.