At least 73 people were reported killed and up to several hundred injured Thursday when a suicide bomber struck inside a famous Sufi shrine in Pakistan while devotees were gathered for a weekly ritual of music and dance, police and medical officials said. 

The Islamic State militant group, based in the Middle East with allied outfits in Pakistan and Afghanistan, asserted responsibility for the blast through an affiliated news site. The Islamic State and similar extremist Sunni groups view Sufism, a mystical strain of Islam, as heretical.

The attack in the isolated town of Sehwan in southeastern Sindh province was one of the country’s deadliest bombings in a decade of terrorism that the government has struggled to combat. Officials at one hospital said they had received 60 bodies and 250 injured patients, including 40 in critical condition.

The bombing at Lal Shahbaz Qalandar shrine followed three successive days of violence that claimed 25 lives in all four provinces of Pakistan and two tribal areas. On Monday, a suicide blast in the eastern city of Lahore killed 13 people and injured scores. An affiliate of the Islamic State, Jamaat-ul-Ahrar, said in an email to journalists that the bombing was the start of an operation targeting government agencies and sites. 

On Wednesday, Pakistan lodged a formal complaint with next-door Afghanistan, alleging that the Islamic State-linked militants were operating from sanctuaries across the border. Late Thursday, army officials announced that all border crossings would be closed until further notice for security reasons. 

It was not possible to confirm, however, whether the Islamic State — also known as ISIS or ISIL — or a local affiliate had carried out the shrine attack. In August, when a bomb killed more than 70 people in the southwestern city of Quetta, the Islamic State and an allied group based in the border region both claimed to have been behind it.

Government troops were sent to the shrine and the surrounding areas Thursday, and all naval hospitals in the region were placed on alert to receive victims. Pakistan’s army chief, Gen. Qamar Javed Bajwa, issued a statement appealing to the nation to remain calm.

“Your security forces shall not allow hostile powers to succeed,” he said. “Each drop of the nation’s blood will be avenged, and avenged immediately. No more restraint for anyone.”

The army chief’s tough declaration echoed a statement made Wednesday by Prime Minister Nawaz Sharif after a meeting with senior civilian and military officials. Sharif vowed to eliminate all terrorism, whether domestic or foreign in origin, and said that all those who threaten Pakistan’s peace and security will be “liquidated by the might of the state.”

Pakistan has often been accused of coddling some violent Islamist groups that serve as its proxies in India and at home while cracking down on others that oppose the Pakistani state and unleash attacks on domestic targets. Recently, though, officials placed an extremist anti-India cleric under house arrest, calling it a policy decision reached by civilian and military leaders. 

Islamist militants, including the Pakistani Taliban, have attacked numerous Sufi shrines in recent years. In November, a shrine in Balochistan province was bombed, killing 45 people. The shrines are open to all, offering poetry and musical events, as well as quiet spaces to meditate, and free food for the poor. 

Officials said Thursday night that security had been increased at Sufi shrines across the country and that some had been temporarily closed, according to reports on Pakistani news channels.

In addition to targeting Sufis, violent Sunni groups have attacked Christians, Shiites and Ahmadiyyas, a faith group that sees itself as a branch of Islam but is reviled by many Muslims. Political leaders in Punjab province — where the Lahore attack occurred — have been accused of appeasing some sectarian groups there.

In Sindh, some political leaders have reportedly resisted pressure from security agencies and provincial officials to ban or better control Islamist extremist groups and seminaries that train and recruit them. Over the past decade, terrorists have targeted shrines, mosques and other sites across the province.

As groups affiliated with the Islamic State, including Jamaat-ul-Ahrar, have become more active in Pakistan in the past year, they have created controversy among many local Islamist factions. Followers of some groups have defected to the foreign-linked outfits, while others have distanced themselves from ISIS connections. 

When Jamaat-ul-Ahrar asserted responsibility for the recent Lahore bombing, it named its planned terror operation for the late leader of Islamabad’s famed Red Mosque, the scene of a dramatic army siege in 2007. But this week, leaders of the mosque denounced the ISIS affiliate as an “enemy of Islam” and said its actions were un-Islamic. 

Mehdi reported from Karachi.