Police in Pakistan have detained 23 people in connection to a blast at a mosque inside a police headquarters that killed 101 people, a senior official who asked not to be named said Wednesday.

Authorities are also probing the possibility that people inside the compound helped to coordinate the attack, the senior provincial police official told AFP on condition of anonymity.

A suicide bomber slipped undetected into a highly sensitive compound in northwest Peshawar and detonated explosives among a row of worshippers in the compound's mosque on Monday, causing a wall to collapse and crush officers.

"We have detained people from the police line (headquarters) to get to the bottom of how the explosive material made its way in and to see if any police officials were also involved in the attack," the senior official said.

"The attacker and facilitators might have had links outside Pakistan."

He said some among the 23 detained were also from the city and nearby former tribal areas which border Afghanistan.

Authorities are investigating how a major security breach could happen in one of the most tightly controlled areas of the city, housing intelligence and counter-terrorism bureaus, and next door to the regional secretariat.

Low-level militancy, often targeting security checkpoints, has been steadily rising in the areas near Peshawar that border Afghanistan since the Taliban seized control of Kabul in August 2021.

The assaults are claimed mostly by the Pakistani Taliban, as well as the local chapter of the Islamic State, but mass casualty attacks remain rare.

Fear in the city

Moazzam Jah Ansari, the head of Khyber Pakhtunkhwa province police force, on Tuesday told reporters that a suicide bomber had entered the mosque as a guest, using 10-12 kilogrammes (about 22-26 pounds) of explosive material earlier brought to the site in bits and pieces.

He added that a militant group that was on-and-off affiliated with the Pakistani Taliban could be behind the attack.

It is Pakistan's deadliest assault in five years and harks back to more than a decade ago when Peshawar was at the centre of rampant militancy.

"The main fear is a second attack, another blast ... a suicide bomber may blow himself in a market," said 55-year-old Naeemullah Jan, a building contractor in the city.

Police have said the mosque blast was a revenge attack against the police force who are on the frontline fighting a resurgence in militancy since the Afghan Taliban came to power across the border.

"Earlier I used to feel safe near the police, now when a police car or officers pass near me, I fear in my heart that they might be attacked and I will also be hurt," 55-year-old Muhammad Haneef Awan told AFP from a market in Peshawar.

Meanwhile, the Taliban government in Kabul warned Pakistan's ministers "to not pass the blame to others".

"They should see the problems in their own house... Afghanistan should not be blamed," foreign minister Amir Khan Muttaqi said in a press conference.

Pakistan is already being hobbled by a massive economic downturn and political chaos, ahead of elections due by October.