Shooting and bomb attacks claimed by DAESH killed at least 16 people north of Baghdad on Friday, days after the organisation's deadliest blasts so far this year in the capital stirred public criticism of government security measures.
Three gunmen opened fire with machine guns around midnight at a cafe in the predominately Shiite Muslim town of Balad where young men, including fans of Spain's Real Madrid football club, had gathered to start the weekend, police and hospital sources said. At least 12 were killed and 25 wounded.
The assailants fled and hours later one of them set off his explosive vest at a nearby vegetable market after police and Shiite militia members cornered him in a disused building and exchanged gunfire, security sources said. Four were killed and two critically wounded, medical sources added.
DAESH said in a statement distributed online by supporters that three suicide attackers targeting Shiite militiamen had detonated their explosives, though security sources said they had only identified one bomber.
A witness saw the scorched body of a suspected assailant hanging upside down from a post outside the cafe on Friday morning.
Residents said they had seized the man from a nearby house where he had fled following the attack. They said they had burned him alive after he confessed. An intelligence official confirmed this account.
DAESH nearly overran Balad, 80 km (50 miles) north of Baghdad, in 2014 and maintains a frontline around 40 km away.
Friday's attackers had passed three police checkpoints before reaching their target, said police sources. Security forces deployed throughout the town, fearing more attacks.
The intelligence official said militants from the powerful Iranian-backed Badr Organisation raided a nearby house and detained 13 members of a Sunni family. There were reports of gunfire in an adjacent orchard.
Iraqi authorities are facing scrutiny over security breaches that allowed suicide attackers to set off three bombs on Wednesday in Baghdad, killing at least 80 people.
The country is also struggling through a political crisis over a cabinet overhaul that has crippled government for weeks and threatens to undermine the US-backed war against DAESH, which still controls swathes of territory in the north and west it seized in 2014.
The fight against the ultra-hardline Sunni militants has exacerbated Iraq's sectarian conflict, mostly between the Sunni minority and the Shiite majority that emerged after the US-led invasion in 2003.
A 22-year-old victim named Tahseen told a doctor he had been smoking a water pipe when a man wearing civilian clothes and a bandolier filled with ammunition crossed the street towards al-Furat Cafe. He recounted hearing several blasts, likely from stun bombs, amid gunfire that lasted about ten minutes.
Inside the cafe hung pictures of famous footballers and a sign for a local group of Real Madrid fans. Witnesses said there was no match on Thursday night but spectators often congregated there.
Real Madrid said its players would wear black arm bands on Saturday to honour the victims.
"Football and sport shall always be spaces in which to come together and in which harmony and peace reign and with which no form of barbaric terrorism will be able to compete," it said in an online statement.
A suicide bombing in March at a youth football match south of Baghdad killed 26 people and wounded 71 others.