A suicide bomber blew himself inside a Baghdad cafe popular with young people using the Internet, killing at least 27.
Dozens more were wounded in one of the worst single attacks in the Iraqi capital this year.
The 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 free victims trapped when the blast collapsed part of the building that also housed a shopping centre below the Dubai cafe which was on the third floor.
Ten years after the US-led invasion, Sunni Islamists linked to al-Qaeda carry out at least one major attack a month, but insurgents have stepped up suicide attacks since the start of the year as part of a campaign to provoke confrontation between the country's Shia and Sunni Muslims.
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 Shia premier's government, where Shia, Sunni and ethnic Kurds share posts in a fragile power-sharing deal that has been mostly paralysed since US 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 neighbouring country's war.