The blasts near a market in the Sadr City area, at least one of which was a suicide bombing, also wounded at least 59 people, the officials said.
The bombings were the deadliest attacks to hit Iraq's capital this year.
IS, which overran swathes of territory north and west of Baghdad in 2014, claimed the attacks in a statement posted online that said two suicide bombers had detonated explosive belts in Sadr City.
Islamic State suicide bomber kills six outside Shia mosque in Baghdad
IS considers Shia Muslims, who make up the majority of Iraq's population, to be heretics and frequently targets them with bombings and other attacks.
Suicide bombings are a tactic almost exclusively used in Iraq by IS.
The jihadist group claimed twin suicide bombings targeting Shia worshippers on Thursday that killed at least nine people.
Those bombings took place in Shuala, another Shiite-majority area in northern Baghdad.
While attacks are still common in Baghdad, violence in the city has decreased significantly since IS launched a sweeping offensive in June 2014, after which many of its militants became occupied with fighting elsewhere.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ