At least 20 people, including a police constable, were killed and more than 30 injured in a suicide bombing on Thursday at Dargah Pir Rakhel Shah in Fatehpur, a small town in the Jhal Magsi district of Balochistan, DawnNews reported.

District Chairman Jhal Magsi, Aurangzaib Magsi confirmed the death toll late in the night.

The deputy commissioner of Jhal Magsi had earlier said that the deceased include at least three children.

The medical superintendent of Gandawah Hospital, Dr Rukhsana Magsi, had earlier said 15 dead bodies were brought to the facility.

She said that another 24 injured were brought to District Headquarters Hospital Gandawah, of which 18 were shifted to Quetta and Larkana for medical treatment.

The governments of Sindh and Balochistan worked closely to rehabilitate those injured in the attack. Jhal Magsi is close to Balochistan's border with Sindh and better connected to larger cities like Jacobabad in the latter province.

The explosion, which police attributed to a suicide bomber, took place at the entrance to the dargah at a time when scores of people had gathered to pay their respects. Thursdays are usually busy in terms of attendance at shrines as the day is considered spiritually significant, but the day was also significant for the dargah as it was hosting a bi-monthly event.

Jhal Magsi is located at a three-hour drive from Jacobabad and Larkana.

District Police Officer Mohammad Iqbal said the bomber had tried to enter the shrine but a security guard stopped him, after which the attacker detonated his explosives.

Initial reports suggested that the explosion took place when the dhamaal — a devotional dance performed at shrines — was being performed after evening prayers.

Balochistan Home Minister Sarfaraz Bugti told DawnNews that "if he [the attacker] had managed to enter the dargah, the death toll would have been much higher."

Answering a question on whether the government was aware of a terrorist threat, Bugti said, "We are in a war zone. We [share] a porous border with Afghanistan. Keeping all these factors in mind, our security forces ensured a peaceful Moharram and they will continue to fight terrorism in Balochistan."

The injured were initially transferred to District Headquarters Hospital.

The attack happened hours after the chief of the military's media wing highlighted the army's efforts in combating terrorism across the country and brought up the role of "non-state actors" that the army believes are being sponsored by enemy spy agencies.

It was the second deadly attack on a shrine in Pakistan in 2017. In February this year, a suicide bomber had killed more than 80 people and injured more than 250 in an attack targeting the busy Lal Shahbaz Qalandar shrine in Sehwan, Sindh.

The army had launched the ongoing Operation Raddul Fasaad in response to the Sehwan bombing, saying it was aiming at eliminating the "residual/latent threat of terrorism".

This was also the second attack on the Pir Rakhel Shah shrine since 2005. On March 19, 2005, at least 35 people were killed and many injured when a suicide bomber exploded himself at the shrine. The dead had included devotees from different sects who frequented the shrine seeking spiritual relief.

Pir Rakhel Shah

According to a blog maintained by the shrine's administrators, Sufi Rakhel Shah was born in 1852 AD in the district of Mirpur, Balochistan. His father, Noor Shah, claimed descent from Hazrat Ali. His eldest brother, Sufi Abdul Nabi Shah, was a disciple of Fakir Jaanullah Shah, a devotee of Sufi Innayatullah Shah.

Rakhel Shah, who is said to have been influenced by his brother's spiritual way of life, was for a time a disciple of Sufi Abdul Sattar of Dargah Jhoke Sharif, which is located in lower Sindh. After spending some time there, Rakhel Shah returned to Fatehpur to live a life of asceticism and charity.

The shrine was built in his devotion.

Timeline: Major attacks on shrines in Pakistan