People gather at the site of a suicide attack at the entrance of the Shi'ite Mausoleum of Sayid Mohammed bin Ali al-Hadi in Balad, north of Baghdad, Iraq, July 8, 2016. REUTERS/Thaier Al-Sudani

The Iraqi premier sacked three Baghdad security chiefs following a devastating bombing in the capital, his office said Friday, hours after another attack to the north left 30 people dead.

The Islamic State jihadist group (ISIS) said it carried out the latest attack — on a Shiite shrine in the town of Balad on Thursday evening — as well as Sunday’s bombing which killed 292 people, one of the deadliest to ever hit Iraq.

A suicide bomber blew up a minibus packed with explosives in a Baghdad shopping district teeming with people ahead of the Eid al-Fitr holiday, sparking widespread anger against the government.

Iraq’s interior minister tendered his resignation after the bombing but the Friday statement was the first announcing that officials were fired following the attack.

Prime Minister Haider al-Abadi issued “an order to relieve the Baghdad Operations commander of his position,” as well as remove the officials responsible for intelligence and security in the capital, his office said.

The head of the Baghdad Operations Command was Lieutenant General Abdulamir al-Shimmari.

An official in Abadi’s office said the others removed were the head of interior ministry intelligence for Baghdad and the official responsible for the capital in the national security adviser’s office.

In Thursday evening’s attack, militants targeted the Sayyid Mohammed shrine in Balad, 70 kilometres (45 miles) north of Baghdad, killing 30 people and wounding 50, Joint Operations Command spokesman Yahya Rasool told AFP.

The shrine was attacked with mortar fire, then by suicide bombers wearing security force uniforms, Rasool said.

Security forces fired on the bombers, who were not able to enter the shrine, and two of them blew themselves up, while a third was shot dead, he said.

The attack sparked a fire that caused heavy damage to the market near the shrine, an AFP journalist reported.

– Trapped and burned alive –

The jihadist-linked Amaq agency said that five ISIS jihadists attacked the shrine, where worshippers were gathered, clashing with Iraqi forces for hours and then detonating explosives they were carrying.

Health Minister Adila Hamoud Hamoud said the bodies of 115 killed in the Baghdad bombing had now been handed over to families, while the identities of 177 others had yet to be determined.

On Tuesday, when the full scale of the death toll had yet to emerge, the minister had told AFP that the process of identifying all of the dead was expected to take between 15 and 45 days.

People have been furious over delays in determining the fate of their loved ones, and with the number of unidentified bodies now bigger, it may take even longer.

The attack has overshadowed what would normally be a joyful holiday for Iraqi Muslims, instead turning it into a time of mourning and sadness.

Police Major General Talib Khalil Rahi said on Thursday that the suicide bomber detonated a minibus loaded with plastic explosives and ammonium nitrate, the first time authorities provided details about the bomb used in the attack.

The initial blast killed a limited number of people, but flames spread and trapped people inside shopping centres that lacked emergency exits, Rahi told a news conference.

Interior Minister Mohammed Ghabban tendered his resignation following the bombing, and authorities also announced the execution of five convicts and the arrest of 40 jihadists in an apparent bid to limit the political fallout.

An official from Abadi’s office told AFP on Wednesday that the premier had accepted the minister’s resignation, though there has been no official statement from him on the matter.

In recent months, ISIS has lost significant parts of the territory north and west of Baghdad which it seized in 2014.

The Sunni extremist group has responded to the battlefield setbacks by hitting back against civilians, particularly Shiites, and experts have warned there may be more bombings as the jihadists continue to lose ground.