The blast, the single deadliest attack in the Iraqi capital this year, comes as the government is locked in a political crisis that some have warned could undermine the fight against IS.
The bombing, which hit the Sadr City area at around 10:00 am, also wounded at least 65 people, the officials said.
The blast set nearby shops on fire and left debris including the charred, twisted remains of a vehicle in the street.
"The state is in a conflict over (government positions) and the people are the victims," said a man named Abu Ali, adding: "The politicians are behind the explosion."
More From This Section
Abu Muntadhar echoed his anger.
"The state is responsible for the bombings that hit civilians," he said. The politicians "should all get out."
Cleric Moqtada al-Sadr, who spearheaded a protest movement demanding a cabinet reshuffle and other reforms, has a huge following in the working class neighbourhood of Sadr City, which was named after his father.
It said a suicide bomber it identified as "Abu Sulaiman al-Ansari" detonated the explosives-rigged vehicle.
IS, which overran large areas in 2014, considers Shiites, who make up the majority of Iraq's population, to be heretics and often targets them with bombings.
Iraqi forces have regained significant ground from IS, but the jihadists still control a large part of western Iraq, and are able to carry out frequent bombings in government-held areas.
Iraq's legislature has been paralysed by a political crisis over replacing the cabinet that the United States and the UN have warned could undermine the fight against IS.
Angry demonstrators broke into Baghdad's fortified Green Zone and stormed parliament after lawmakers again failed to approve new ministers last month.
While the protesters withdrew the following day, parliament has still yet to hold another session.