The other bombings hit a football field and a market, the latest in a upsurge of violence that has killed more than 3,400 people so far this year, according to an AFP tally.
Militants have carried out a number of attacks on cafes in recent weeks, especially during the Muslim holy month of Ramadan, when many Iraqis went to cafes after breaking their daytime fast.
This Ramadan, which ended last week, was one of the deadliest for Iraq in years, with more than 800 people killed in attacks.
In Muqdadiyah, also north of Baghdad, a bomb exploded near a football field, killing four people and wounding 14, among them three children.
More From This Section
And in the nearby Diyala provincial capital Baquba, a bomb exploded in a market, killing four people and wounding 20.
The attacks came a day after Al-Qaeda front group the Islamic State of Iraq and the Levant claimed attacks that killed more than 70 people on Saturday.
"The Islamic State mobilised... In Baghdad and the southern states and others to convey a quick message of deterrence on the third day of Eid al-Fitr," the group said, referring to the holiday marking the end of Ramadan.
The attacks came just weeks after assaults on prisons near Baghdad, also claimed by the Al-Qaeda front group, freed hundreds of prisoners including leading militants.
The brazen assaults highlighted both the growing reach of militants in Iraq and the rapidly worsening security situation.
Analysts, as well as global police organisation Interpol, had warned that the jailbreaks could lead to a rise in attacks, as the escapees were said to include senior Al-Qaeda militants.
Violence in Iraq has increased markedly this year, with analysts saying the upsurge is driven by anger among the Sunni Arab minority that the Shiite-led government has failed to address, despite months of protests.