Iraq was in mourning Tuesday for dozens of people killed when a bomb ripped through a crowded Baghdad market on the eve of a Muslim feast in what the Islamic State group claimed as a suicide attack.

The bloody carnage Monday evening, one of the deadliest attacks in years in the war-scarred country, reportedly cost at least 36 lives, mostly of women and children, hours before the start of Eid al-Adha, the Muslim festival of sacrifice.

It sparked revulsion and renewed fears about the reach of the IS, which lost its last territory in Iraq after a gruelling campaign that ended in late 2017, but retains sleeper cells in remote desert and mountain areas.

The Sunni Muslim jihadists claimed on the Telegram messenger service that an IS suicide bomber detonated an explosives belt in the Woheilat market of northeast Baghdad's Shiite district of Sadr City that was busy with Eid shoppers.

Iraqis inspect the site of the explosion in a popular market in the mostly Shiite neighbourhood of Sadr City
Iraqis inspect the site of the explosion in a popular market in the mostly Shiite neighbourhood of Sadr City AFP / AHMAD AL-RUBAYE

In the panic and chaos of the attack, screams of terror and anguish filled the air. When the smoke cleared, human remains lay strewn amid scattered sandals, market produce and the charred debris of stalls.

President Barham Salih condemned the "heinous crime of unprecedented cruelty on the eve of Eid", writing on Twitter that the perpetrators "do not allow people to rejoice, even for a moment".

No official death toll has yet been released by Iraqi authorities, but medical sources told AFP at least 36 people were killed and about 60 wounded.

Map locating Sadr city in Baghdad, Iraq, where a fatal explosion occurred at a market.
Map locating Sadr city in Baghdad, Iraq, where a fatal explosion occurred at a market. AFP / Kenan AUGEARD

Prime Minister Mustafa al-Kadhemi said the "cowardly attack illustrates the failure of terrorists to regain a foothold after being defeated by our heroic security forces" and vowed that "terrorism will not go unpunished".

The attack came days before Kadhemi was to meet US President Joe Biden in Washington, and ahead of a scheduled parliamentary election in October.

At Sadr General Hospital, doctor-turned-parliamentarian Jawad al-Moussawi visited some of the survivors on Tuesday.

"Those innocent victims who perished yesterday were children and women, what is their sin? They had nothing to do with any political or sectarian goals," he told AFP from the grounds of the public hospital.

Dozens were wounded in the blast, one of the worst in the Iraqi capital for years
Dozens were wounded in the blast, one of the worst in the Iraqi capital for years AFP / AHMAD AL-RUBAYE

Osama al-Saidi, head of the Iraqi Political Science Association, said it was "a clear message that IS is still present and is able to strike targets in Baghdad".

"Whenever elections approach, terror attacks happen with the aim of sending a political message," he said.

Deadly attacks were common in Baghdad during the sectarian bloodletting that followed the US-led invasion of 2003, and later on as IS swept across much of Iraq.

Iraq declared IS defeated in late 2017 after a fierce three-year campaign and attacks became relatively rare in the capital -- until January this year when a twin IS-claimed suicide bombing killed 32 people in another Baghdad market.

The US-led coalition that supported Iraq's campaign against IS has significantly drawn down its troop levels over the past year, citing increased capabilities of Iraqi forces.

The latest attack sparked condolences from abroad, and recriminations among Iraqi political leaders.

Russian President Vladimir Putin said "the murder of dozens of civilians ... is shocking in its cruelty and cynicism" and called for the perpetrators to "receive the punishment they deserve".

The foreign ministries of Iraq's neighbours, Iran and Turkey, respectively, condemned the bombing as a "barbaric act" and "heinous terror attack".

Pointing to security failings, lawmaker Adnan al-Zurfi accused commanders of the Falcon Cell counter-terrorism unit of having turned from "intelligence gathering to politics".

Many ordinary Iraqis reacted with grief and a sense of helplessness in a country that has endured decades of war and insurgency, on top of ongoing economic woes and political crises.

On social media, popular comedian Ahmed al-Basheer recalled that only days ago at least 60 people died when a fire tore through a Covid hospital unit in the southern city of Nasiriyah.

"Every day there's a new calamity," he wrote. "We're tired of everything."