Another car bomb exploded near the General Retirement Department in central Baghdad a few hours later, according to spokesman with Iraqi Joint Joint Operations Command Col. Ibrahim Mohammed. The explosion killed one person and wounded six others.
Families were gathering after breaking their daily fast as part of Islam's holy month of Ramadan when the bomb near the ice cream shop went off.
Footage from the scene showed blood and body parts scattered everywhere, as a young child in a pink t-shirt walked between bodies, sobbing.
Muslims often stay out late during Ramadan, which began Friday, after breaking their fast.
ISIS claimed responsibility for the attack in a statement published on Twitter and Telegram by the group's media wing, Amaq. The statement said ISIS targeted a gathering of Shiites.
Iraqi Interior Minister Qasim Mohammad al-Araji said authorities would "track (ISIS) down wherever they may be."
"They targeted a group of civilians; families, women and children in these nights of Ramadan and this is clear evidence that this organization is a terrorist one trying to kill civilians by any means," he told journalists.
Car and roadside bombs are not uncommon in Baghdad. ISIS this year has carried out several attacks across the capital and killed dozens of people.
On Sunday, less than two days before the ice cream shop explosion, a suicide bomber killed four security officers at a security checkpoint northeast of Baghdad.
Ten people were wounded in the blast, which Iraqi police attributed to ISIS.
In 2014, ISIS took control of Mosul, Iraq's second largest city. Iraqi forces in October last year kicked off an offensive to retake the city and on Saturday, security forces started an operation to take the remaining neighborhoods in western Mosul
that are still under the group's control.