The late evening blast in west Baghdad came just two days before provincial elections that will be a major test of Iraq's political stability more than a year after the last American troops left the country.
Police and witnesses said emergency workers struggled to extricate victims trapped when the blast collapsed part of the building that also housed a shopping center below the Dubai cafe which was on the third floor.
"It was a huge blast," a police official at the scene said. "Part of the building fell in and debris hit people shopping in the mall below."
More than 30 people were killed in a series of bombings across Iraq on Monday and more than a dozen election candidates have been killed in the run-up to the vote.
Security officials have been expecting more attacks before Saturday's ballot for provincial councils that will be a measure of Prime Minister Nuri al-Maliki's political muscle before the parliamentary vote in 2014.
A surge in violence in Iraq has accompanied the political crisis in the Shiite premier's government, where Shiite, Sunni and ethnic Kurds share posts in a fragile power-sharing deal that has been mostly paralyzed since U.S. troops left in December 2011.
Al Qaeda's local wing, Islamic State of Iraq, has said it will keep up attacks and security officials say the group is gaining ground and recruits in the western desert bordering Syria, thanks in part to a boost from the flow of insurgents and funds into the neighboring country's war.