Two blasts ripped through the Iraqi capital of Baghdad just days into the holy month of Ramadan, killing at least 27 people and wounding more than 100.

ISIL claimed the first and deadliest suicide car bomb attack, which took place shortly after midnight at a busy ice cream parlour in Karrada, killing at least 16 people and injuring at least 75 - with children among the victims.

Scenes of panic and carnage followed the explosion in the Shia district, where last July ISIL bombed close to 300 people to death in the worst attack in 13 years of war.

ISIL considers members of Iraq's Shia Muslim majority to be heretics and frequently carries out attacks against them.

A number of wounded lay on the ground, others propped themselves up on the colourful park benches outside the ice cream shop.

One young girl, wearing a ribbon and bow in her hair, wandered the scene dazed.

During Ramadan, people stay up late and many eat out to prepare for the fast the next day.

"Families were out and the place was crowded," Hayder al-Khoei, a London-based Middle East expert, told Al Jazeera.

Al-Khoei explained that the armed group "timed Tuesday's attack to cause maximum impact".

"The suicide bomber detonated himself just after midnight. It was a hot day and he targeted a popular ice cream parlour in Baghdad," he said.

Second explosion

A second deadly explosion struck the Al-Shahada Bridge area later in the morning, killing at least 11 people and wounding 41, according to security sources and witnesses.

A car bomb there exploded near the country's main pension office close to the River Tigris.

Ibrahim al-Zararee, writing on Twitter, said he was close to both attacks. 

"I was near the site of the explosion [in Karrada a] few hours before it happened and it was full of life. Now it's full of death and horror," he said. "Today I was few seconds away from [the blast Al-Shahada Bridge]. The explosion today was near the General Retirement Department. A walking distance from the famous Mutanabi Street."

Video posted to social media showed plumes of black smoke rising from a building.

No group immediately claimed responsibility for the second bombing, though it also bore the hallmarks of ISIL.

Brett McGurk, US special envoy to the anti-ISIL coalition, tweeted after the first attack: "ISIS terrorists tonight in Baghdad target children and families enjoying time together at an ice cream shop. We stand with Iraq against this evil."

ISIL in focus

The attacks in Baghdad come as Iraqi forces fight to retake the last ISIL-held areas of Mosul, a city that was the group's most emblematic stronghold.

Iraqi commanders say the offensive, which recently entered its eighth month, will mark the end of ISIL in Iraq, but concede the group will likely increase attacks in the wake of military defeats.

Michael Pregent, former US army officer and Iraqi government adviser with the Hudson Institute think tank, told Al Jazeera: "[Tuesday's attack is] meant to stoke a sectarian flame to get some sort of response from Shia militias from the government. It's also meant to discredit the Baghdad government.

"That's something that Shia militias, recently criticised by Prime Minister Haider al-Abadi, can also use to criticise the current government ahead of the 2018 elections."

Three neighbourhoods north of Mosul's Old City - Al-Shifaa, Al-Saha and Al-Zinjili - are now the target of a broad assault by Iraqi soldiers, police and special forces that was launched last week.

On Tuesday, an Iraqi army officer said that security forces were proceeding slowly in Al-Shifaa in a bid to protect infrastructure.

"Attacks like this demonstrate ISIL's desperation," Iraqi analyst Ali Hadi Al-Musawi told Al Jazeera. "They’re being thoroughly routed on the battlefield, they're no longer able to function as a proto-state in Iraq, so they have to resort to attacking soft targets at an ice cream parlor in order to maintain some sort of perverse relevance."

An Iraqi man walks past the site in Karrada where a car bomb exploded, killing at least 15 people [Khalid al-Mousily/Reuters]

Source: Al Jazeera and news agencies