A bomb targeting diners in a crowded cafe north of Baghdad has killed 16 people and wounded 20, Iraqi authorities said.

Police said that the attack on Thursday night occurred inside the Noufel cafe near the town of Muqdadiyah, about 90km north of the capital.

Hospital officials confirmed the casualty figures. All officials spoke on condition of anonymity as they were not authorised to speak to journalists.

In a separate incident in al-Amiriya district in Baghdad's west, a bomb placed in a garden where people were celebrating a wedding exploded, killing four people.

In Madaen, about 30km southeast of Baghdad, a roadside bomb planted near a cafe went off, killing three people.

Cafes in Iraq where people gather at night during the holy Muslim month of Ramadan after breaking fast have become frequent targets of armed groups recently.

Also on Thursday, armed men killed a police officer in the northern city of Mosul, while a child died in a roadside bombing, and a civil servant was also shot dead in the east of the city.

More than 750 people have been killed in attacks in Iraq so far in July, according to violence monitoring group Iraq Body Count.

The steady deterioration of security in Iraq was highlighted by a mass jailbreak near the capital on Sunday when around 500 convicts, including senior al-Qaeda operatives, escaped after armed men attacked two prisons.

The Islamic State of Iraq and the Levant, which was formed through a merger between al-Qaeda's Syrian and Iraqi branches, claimed responsibility for the raids and said it had freed its jailed comrades after months of preparation.

Source: Agencies