Two men injured in an explosion outside a Shiite mosque in Parachinar in northern Pakistan share a hospital bed on March 31, 2017. (STR / AFP/Getty Images)

At least 22 people were killed and more than 70 injured Friday when a bomb exploded outside a Shiite Muslim mosque in northern Pakistan, officials said.

Residents of the town of Parachinar, near the Afghan border, said explosives were planted in a car near the main gate of the town’s main Shiite mosque shortly before weekly Friday prayers, when thousands of worshipers gather. The gate is used by women congregants.

The attack was claimed by Jamaat-ul-Ahrar, a faction of the Pakistani Taliban militant federation, which was responsible for several deadly attacks across the country in the last two months.

In January, the group said it carried out the suicide bombing of a vegetable market in Parachinar that killed 28 people and wounded hundreds.

The Sunni militant group has targeted Shiites, Christians and other religious minorities in recent years in Pakistan.

Javed Hussain, a shopkeeper near the site of Friday’s blast, said a car that was apparently used in the explosion was badly damaged and that the blast struck several vehicles and shops nearby.

Residents then attempted to march to the main government compound in Parachinar, capital of the Kurram tribal region, to demand better security. The public demonstration mirrored the increasing anger shown by Pakistanis amid a growing list of militant attacks.

Witnesses said paramilitary troops deployed at the government compound fired several shots to disperse the demonstrators. Two people reportedly died in the shooting, but officials did not confirm the account.

The government hospital in Parachinar was overwhelmed with victims and Pakistan’s military said in a statement that critically wounded people were being airlifted to Peshawar, the nearest city, for treatment.

Sadique Hussain, organizer of the Haideri Blood Bank Society in Parachinar, said that 22 bodies had been recovered from the scene and at least 30 people were in critical condition in the main hospital.

Ali is a Times special correspondent.