Islamabad, Pakistan - A suicide bomber has blown himself up at the entrance of a Sufi shrine in Pakistan, killing at least 18 people and wounding 25 others, local officials have told Al Jazeera.

The attack happened on Thursday at the Fateh Pur Shrine compound in Jhal Magsi district in central Balochistan province.

"The suicide attacker was intercepted at the shrine's main entrance," said Muhammad Iqbal, a local police official.

"He attempted to barge inside the main shrine," Iqbal added. "Police guards opened fire, and some steps away from the gate [the attacker] detonated his explosive."

This same shrine, built to honour Sufi saint Pir Rakhel Shah, was also attacked on March 19, 2005, in one of the first such attacks in Pakistan. At least 35 people were killed in that suicide attack.

Dr Rukhsana Magsi, medical superintendent at the DHQ hospital in Jhal Magsi, said later on Thursday that they had received 18 bodies. Of the 25 wounded, 20 suffered serious injuries and were being transported to other hospitals.

"Casualties are still arriving," Magsi said. "The wounds, the serious ones, many people have either lost their hands, some have been hit in their heads with shrapnel.

"The dead bodies are now being handed over to their families."

There was no immediate claim of responsibility.

Pakistan has been battling the Tehreek-e-Taliban Pakistan (TTP) and other armed groups since 2007. Violence has dropped significantly in the past three years since the launch of a military operation to evict those groups from sanctuaries in the volatile northwestern tribal districts.

Since 2016, however, it has been facing a growing threat of attacks from the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group, which has claimed responsibility for several suicide attacks, particularly those targeting Sufi shrines such as the one attacked on Thursday.

In November, at least 52 people were killed in an ISIL-claimed suicide bombing at a shrine in the Hub district of Balochistan, south of Jhal Magsi.

In February, ISIL claimed responsibility for the deadliest attack on Pakistani soil since 2014, in which a shrine in neighbouring Sindh province was targeted, killing 88 people.

Saadullah Akhtar in Quetta contributed to this report.