BAGHDAD — At least 40 people were killed in a suicide bombing at a Shi’ite shrine north of Baghdad, medical officials said Friday, as Iraqis took to the streets of the capital to demonstrate against a government they say is failing to protect them.
Three suicide bombers dressed in military uniforms opened fire on worshipers gathered at the shrine in Balad late Thursday, said Brigadier General Yahya Rasoul, a spokesman for the Iraqi military. Two then detonated their explosives at the shrine’s gate, and the third was killed before he could trigger his device, Rasoul said.
By Friday afternoon, the death toll had climbed to 40 people, said Saib al-Shami, deputy head of Balad hospital.
He said 74 people were wounded. Seven of those killed were not immediately identified because they were burned beyond recognition in the fire that followed the bombing, Shami said. The Health Ministry confirmed the figures.
The attack came less than a week after the Islamic State’s deadliest single suicide bombing in Iraq, which killed at least 292 people in the Karrada neighborhood of Baghdad early Sunday. A spate of attacks in several countries have been linked to the group during the Muslim holy month of Ramadan, a surge of violence that has coincided with Islamic State losses in Iraq and Syria.
The killings have triggered protests in the capital, where there were already mass demonstrations against the government.
Amid growing discontent, Prime Minister Haider al-Abadi sacked the head of security for Baghdad on Friday, according to a statement from his office. Other security officials were also fired, the statement said, without providing further details.
‘‘Our blood became cheap in Karrada and Balad,’’ said Hadi Talib, 40, as he marched from a main square in Baghdad to the bomb site. He said demonstrations felt futile.
‘‘The solution is to protest inside the Green Zone and burn it like they are burning our cities and killing our sons,’’ he said. The Green Zone is a fortified area in central Baghdad in which government ministries and Parliament are located.
On Thursday night, the shrine in Balad, about 55 miles northwest of Baghdad, was packed with pilgrims visiting to mark Eid al-Fitr, a festival held at the end of Ramadan, said Ali Bandar, 27. Most of the dead were pilgrims, he said.
The Islamic State, which considers Shi’ite Muslims heretics, asserted responsibility in a statement circulated online.