At least 87 people were killed and 170 wounded in a suicide bombing at a mosque in Peshawar, north-western Pakistan.
Police say a suicide bomber hit worshippers during afternoon prayers, while officials and witnesses said more than 300 were in the mosque at the time of the attack.
“We're getting that the terrorist was standing in the first row,” Defence Minister Khawaja Asif told Geo TV.
The blast caused part of the main hall to collapse, trapping people underneath the rubble.
It is the deadliest attack since a suicide bombing killed 64 people at a mosque in the city last March.
A commander for the Pakistani Taliban, the TTP, claimed responsibility for the attack on Twitter, but there was no immediate comment from its main spokesman.
Survivors said they were knocked unconscious by the blast, which was heard several kilometres away.
Meena Gul, a police officer who was in the mosque, said he was unsure how he escaped unhurt.
He heard the wounded screaming and crying after the blast, which killed the mosque's imam.
"The screams of the people are still echoing in my mind," policeman Shahid Ali told AFP. "People were screaming for help."
The attack occurred just after afternoon prayers began, he said.
"I saw black smoke rising to the sky. I ran out to save my life."
The mosque is inside a highly-fortified compound housing the headquarters of the provincial police force and a counter-terrorism department.
It is unclear how the attacker was able to gain access to the compound, where 300 to 400 police personnel were present at the time of the bombing.
Several of the wounded are in a critical condition, an official at the city's Lady Reading hospital told Reuters, with the death toll expected to rise.
Khyber Pakhtunkhwa province, which borders Afghanistan, has previously been targeted by both ISIS and the Pakistani Taliban, which is separate from but closely aligned with the Afghan Taliban.
Militants last month seized a counter-terrorism centre in the city of Bannu and took hostages to negotiate with government authorities.
Prime Minister Shehbaz Sharif vowed “stern action” against the perpetrators and said security and counter-terror capacity would be increased in the province.
“My prayers and condolences go to victims families,” said former prime minister Imran Khan.
“It is imperative we improve our intelligence gathering & properly equip our police forces to combat the growing threat of terrorism.”
Violence has increased in the past year, with many attacks claimed by TTP.
Analysts say the group has been emboldened by the Taliban's return to power in Afghanistan.
Border areas, where the TTP has increased activity against police and security forces, have been particularly affected.
Six policeman were killed in a TTP attack in November, days after the group ended a nationwide ceasefire with the Pakistani government.
The group claimed it was behind a suicide bombing the following month that killed one police officer in the capital Islamabad, which has largely been spared the low-level attacks conducted elsewhere in the country.