The explosion took place on Thursday morning in a restaurant popular with local police.
Reports differ over whether one or two bombers blew themselves up in the attack.
The restaurant attack was followed shortly afterwards by a car bomb in the city of Tikrit that left 10 army recruits dead.
According to an internet statement, which could not be verified, Iraq's al-Qaida said it had carried out the bombing of the Baghdad restaurant.
"A lion from our martyrs' brigade embedded himself among the infidel police and security forces in the restaurant," said the statement on an Islamist site often used by the group.
The statement said the attack was part of an al-Qaida campaign to avenge a raid by US and Iraqi forces on suspected rebel strongholds in Qaim.
The blast echoed through central Baghdad at about 9.45am (0645 GMT) on Thursday, when police officers frequently stop by for breakfast at the restaurant in Abu Nuwas street.
"A suicide bomber wearing an explosive vest went into a restaurant," a police official said shortly after the blast which could be heard from several kilometres away, reports Reuters.
The Baghdad attack was one of
the biggest in recent months
Another report quoted Police Major Abd al-Hussein Minsef as saying two bombers attacked, leaving seven police officers and 26 civilians dead and 19 others injured.
"Body parts are all over the place, we are still collecting them," a police officer at the scene said.
The police officer said at least four Iraqi police patrols were having their breakfast at the restaurant when the bomber
It was one of the biggest attacks in the capital in recent months and came a day after at least six people were killed and 25 wounded by two car bombs in a mainly Shia area of Baghdad.
In another development on Thursday, a car bomb in Sadddam Hussein's hometown of Tikrit killed 10 people and wounded 20 more at an army recruiting centre, hospital sources and police said.
Two more civilians were killed an hour later in the same spot
when another bomb exploded, police said.
Elsewhere in the country, the bodies of 27 people who had been shot in the head were discovered in open countryside south of the capital.
The grisly discovery of the bodies was made in the region of Jassan, near the town of Kut, according to army colonel Badr al-Basri, who said the victims' hands and feet were bound.
All of the dead were dressed in civilian clothes.
Meanwhile Aljazeera has learnt that nine Iraqis have been killed in an air strike by US forces over the al-Taji district, north of Baghdad.
US forces also sealed off the nearby al-Tarmiya area and used loudspeakers to inform residents to remain in their homes, while a raid of houses was conducted.
On Wednesday, seven Iraqi police officers were killed and nine people, including three civilians, were wounded after a car bomber hit a police patrol north of Baghdad, medical and army sources said.
The attack took place in the city of Baquba, 65km north of the capital.