The mosque’s caretaker Syed Ashfaq – who lives next door – also heard gunfire, and began running towards the mosque to help.

“By the time I reached it there had already been an explosion,” he told the BBC. “Bodies were lying everywhere, some were missing arms, some missing legs. We took the most injured in our own vehicle [to hospital].”

Islamabad’s deputy commissioner Irfan Memon said on X that the death toll stood at 31, with the injured numbering 169.

Pictures from local hospitals show the injured being brought by private vehicles and ambulances, with one photographer for news agency AFP saying they saw dozens of people arriving at hospital.

Attacks are relatively rare in the capital, although one in November left 12 dead. Another 27 were injured in the blast, outside a courthouse.

The blast on Friday comes after a week of violence which saw 58 civilians killed in coordinated attacks in the province of Balochistan.

The Balochistan Liberation Army (BLA) rebel group said it was behind the attacks. The military – which has been fighting an insurgency in the region for decades – said it had killed more than 200 militants in response.

Last year was also Pakistan’s deadliest in over a decade as combat-related deaths surged 74%, with militants accounting for more than half the death toll, according to a new report released by an independent think tank.

The Pakistan Institute for Conflict and Security Studies (PICSS) said violence in Pakistan left 3,413 people dead – up from 1,950 in 2024 – with 2,138 militants killed.

Additional reporting Caroline Davies