At least 100 fighters sneaked into Kirkuk in the early hours of Friday with machine guns, rocket propelled grenades, suicide vests and a message: "Islamic State (IS) has taken over".
The message blared out from several mosque loudspeakers while the militants went on a rampage.
By the time they had blasted their way across the city in a brazen and complex attack, 99 civilians and members of the security forces were dead and 63 of their own were in the morgue, according to Iraqi security officials.
The scale of the operation - the largest of several by IS to divert an advance on their stronghold in Mosul - shows how tough the battle for Mosul may become and points to a continued ability of the militant group to undermine security across the country even if its northern bastion falls.
Accounts gathered by Reuters from residents, police, security and intelligence officials suggest it was carried out by forces that were highly trained, well-prepared and - alarmingly for the government - supported from inside Kirkuk.
Like the IS attacks on Paris last year, the operation appeared aimed at spreading chaos and fear rather than seizing territory.
Although the heaviest fighting was over by Friday night, clashes continued for two days and officials are still searching for IS units in the city.
Kirkuk, 100km southeast of Mosul, has been controlled by Kurdish forces since the Iraqi army retreated from advancing IS forces in 2014.
The operation was not improvised: a video found on a Samsung Galaxy phone on the body of a fighter shows footage of targets around the city filmed before the attack.
At the time the clashes were spreading out across Kirkuk, four IS militants wearing suicide vests also attacked a power station in the town of Dibis, 30km away.
At least 11 people were killed, among them three Iranian engineers who had been working at the plant.
As Iraqi forces look to regain control of Mosul, experts say it's hoped the attack will cleanse Islamic State from Iraq.
The liberation of Iraq's second largest city is expected to be a morale-booster for the besieged country.
International relations expert Stephen Hoadley told Paul Henry it's not only a blow for IS, but also a boost for the Iraqi army.
"Just two years ago the Iraqi army cut and ran from Tikrit and Ramadi, now they've captured Ramadi and Tikrit, now they're going to capture Mosul. It'll be a symbol that New Zealand's training efforts for example have paid off."
Around 30,000 Iraqi troops, assisted by the US, are descending on Mosul.
World Vision UK spokesperson Chris Weeks, says the conditions are incredibly challenging for civilians caught in the fight.
"We're seeing up to 200 people a day arrive in a refugee camp near where I am, the stories they're telling are incredibly traumatic, but the main offensive on the main part of Mosul hasn't even started yet.
"We're talking now about thousands of displaced people. When the main offensive starts we'll be talking about hundreds of thousands.
"We don't even know the population of Mosul at the moment. It's been under control for roughly two years."
Reuters / Newshub.