Devotees gather around the bodies of blast victims after a suicide bombing near a sufi shrine in the Gandawa area of Jhal Magsi district of Balochistan

Quetta — A suicide bomber blew himself up at a Sufi shrine in Jhal Magsi district of Balochistan on Thursday, killing at least 21 and wounding more than 30 people.

The incident took place in Dargah Pir Rakhel Shah in Fatehpur, a small town in the Jhal Magsi district, some 266 kilometers away from Quetta. The deceased include an assistant sub-inspector of police and three children.

“We have received 18 bodies and 25 injured,” Dr Rukhsana Magsi, the medical superintendent of District Headquarters Hospital (DHQ) in Jhal Magsi, said earlier.

A suicide bomber blew himself up after he was intercepted by police guards on duty outside the shrine, local officials told media.

Islamic State claimed responsibility for the attack.

The suicide bomber struck outside the shrine when it was packed with people, attending anniversary celebrations of Syed Cheesal Shah.

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

The regional franchise of ultra-extremist Islamic State group claimed responsibility for the attack via its Amaq news service, according to Reuters news agency.

This was also the second attack on the Pir Rakhel Shah shrine since 2005. On March 19, 2005, about 35 people were killed in a bomb blast on the same shrine.

In November 2016, at least 52 people were killed in a bombing at the shrine of Shah Norani in Khuzdar district of Balochistan.