Gunmen attacked a cafe with gunfire and grenades north of the Iraqi capital and later detonated suicide belts against security forces in pursuit, officials said on Friday.
At least 16 people were killed and 30 wounded, including several members of the security forces, in the attack in the town of Balad and the ensuing chase, they said.
Officials said the gunmen were from the Islamic State group, which claimed the attack in an online statement.
“A group of armed men from Daesh (an Arabic acronym for IS) disguised in security forces uniforms attacked a cafe in Balad at around midnight, using grenades and gunfire,” Ammar Hekmat al-Baldawi, a deputy governor of Salaheddin province, told AFP.
“They fled to a nearby farming area. They blew themselves up when the security forces and some residents chased them and got close,” he said.
Baldawi said the attack took at place around midnight (2100 GMT on Thursday) and that the hunt for some of the attackers was ongoing.
“There were five or six attackers — four of them blew themselves up. The hunt is not over because we think there could be up to two of them still on the run,” he said.
He said 16 people were killed, including several members of the police and the Hashed al-Shaabi paramilitary organisation that includes most Shiite militias.
The modus operandi was a departure from the suicide car bombings IS has used as its main tactic to inflict maximum casualties in Shiite towns and cities.
Balad is a large town 80 kilometres (50 miles) north of Baghdad. Its population is predominantly Shiite but it is surrounded by many Sunni-dominated rural areas.
A police lieutenant colonel who declined to give his name said the shooting claimed 12 lives, and added that four other people, two police and two members of Hashed forces, were killed later when one attacker detonated his suicide belt.
A doctor at Balad hospital gave the same toll.
In its statement posted on social media, IS said a commando of three jihadists stormed a gathering of Hashed members, shooting several dead, before one of them blew himself up as rescue services tried to evacuate the wounded.
It said the two other attackers killed several others when they detonated their explosive belts.