A suicide bomber has blown himself up at a market in a town north of the Iraqi capital Baghdad, killing at least four security personnel, hours after gunmen killed 12 people at a cafe in the same town. 

At least 25 people were also wounded in the attack on the restaurant in the mainly Shia town of Balad, hospital and police sources said on Friday. 

The attackers used machineguns to spray the cafe with bullets from cars parked outside for about 10 minutes before leaving the scene, the Reuters news agency reported.

They passed three police checkpoints before reaching their target, police sources told Reuters.

The town is about 40km from a frontline held by Shia militiamen, which was almost overrun by the Islamic State of Iraq and the Levant (ISIL) group in 2014.

Iraqi authorities have faced criticism over security breaches after suicide attackers set off three bombs on Wednesday in Baghdad killing at least 80 people in the bloodiest day for the city so far this year.

The country is in the grip of a political crisis over a cabinet overhaul that has crippled the government for weeks and threatens to undermine the United States-backed war against ISIL, which still controls swaths of territory in the north and west.

Source: Reuters