The attack in a predominantly Shiite neighbourhood, which also left 60 people wounded, came days after Al-Qaeda warned it would continue targeting Shiite Muslims and barely a month after US troops completed their withdrawal.
It raised fresh concerns about the ability of domestic forces to provide security.
The 11:00 am (0800 GMT) attack struck outside Zafraniyah hospital in east Baghdad as a funeral procession was transporting the bodies of a family who had been killed in the capital a day earlier.
Medical and security officials said at least 31 people were killed and 60 wounded. Eight security officers and four women were among those who died.
Attacks elsewhere in Iraq left three dead and three hurt.
Friday`s blast came a day after violence in Iraq killed 17 people, and is the capital`s bloodiest day since a wave of bombings in Baghdad killed 60 people on December 22.
US troops left behind a domestic security force that officials say is capable of maintaining internal security, if not defending Iraq`s borders, airspace and territorial waters.
The Zafraniyah attack comes amid a month-long political crisis that has pitted the Shiite-led government against the main Sunni-backed bloc, stoking sectarian tensions.
The row erupted when authorities charged Sunni Arab Vice President Tareq al-Hashemi with running a death squad and Prime Minister Nuri al-Maliki, a Shiite, called for his Sunni deputy Saleh al-Mutlak to be sacked after the latter said the premier was "worse than Saddam Hussein".
The United Nations and the United States have urged calm and called for dialogue but oft-mooted talks among Iraq`s political leaders have yet to take place.
Messages have meanwhile been posted by Al-Qaeda supporters on the Honein jihadist forum vowing further attacks targeting Iraqi Shiites.
(M014)
Editor: Ella Syafputri
Copyright © ANTARA 2012