In the deadliest incidents, 24 people were killed in two blasts in Jisr Diyala district, southeast of the city.
The sources said the first bomb went off in a commercial area near restaurants, shops and street stalls. Police tried to prevent people gathering at the scene, but shortly afterwards a car bomb was detonated in the same area. Three of the people killed in the second blast were police, they said.
Earlier, five other explosions hit northern and southern neighbourhoods, the sources said.
There was no immediate claim of responsibility for the attacks, which come as Iraqi security forces battle Islamic State militants who control large areas of north and west Iraq, and who have claimed many recent bombings in Baghdad.
In the western province of Anbar, Iraqi troops backed by Shi’ite militia and tribal fighters are trying to drive Islamic State fighters out of al-Baghdadi on the Euphrates River.
The town is just five km (three miles) east of the Ain al-Asad airbase where U.S. Marines are training Iraqi forces for a larger offensive against Islamic State.
A U.S. official said last week that an assault to recapture the northern city of Mosul, the largest city under Islamic State control, would probably be launched in April or May.
Iraqi military officials have declined to confirm such a timetable. Iraqi troops and militia forces have been gathering for an expected offensive against the militants further south in Salahuddin province, between Baghdad and Mosul. (Reuters)