The Bajur district near the Afghan border was a stronghold of the Pakistani Taliban - a close ally of Afghanistan's Taliban government - before the Pakistani army drove the militants out of the area.
Supporters of hardline Pakistani cleric and political party leader Maulana Fazlur Rehman, whose Jamiat Ulema Islam generally supports regional Islamists, were meeting in Bajur in a hall close to a market outside the district capital.
Officials were announcing the arrival of Abdul Rasheed, a leader of the Jamiat Ulema Islam party, when the bomb went off in one of Pakistan's bloodiest attacks in recent years.
Provincial police said in a statement that Sunday's attack was carried out by a suicide bomber who detonated his explosives vest close to the stage where several senior leaders of the party were sitting.
It said initial investigations suggested the Islamic State group could be behind the attack, and officers were investigating.
"There was dust and smoke around, and I was under some injured people from where I could hardly stand up, only to see chaos and some scattered limbs," said Adam Khan, 45, who was knocked to the ground by the blast and hit by splinters in his leg and both hands.
The Pakistan Taliban (TTP) said in a statement that the bombing was aimed at setting Islamists against each other.
Zabiullah Mujahid, a spokesman for the Afghan Taliban, said on the social media platform X that "such crimes cannot be justified in any way".
The Afghan Taliban's seizure of power in Afghanistan in mid-August 2021 emboldened the TTP. They unilaterally ended a ceasefire agreement with the Pakistani government in November, and have stepped up attacks across the country.
The bombing came hours before the arrival of Chinese Vice Premier He Lifeng in Islamabad, where he was to participate in an event to mark a decade of the China-Pakistan Economic Corridor, a sprawling package under which Beijing has invested billions of dollars in Pakistan.
The bombing was one of the worst attacks in the northwest since 2014, when 147 people, mostly schoolchildren, were killed in a Taliban attack on an army-run school in Peshawar.
Prime Minister Shehbaz Sharif and President Arif Alvi condemned the attack and asked officials to provide all possible assistance to the wounded and the bereaved families. Sharif later, in a phone call to Rehman, the head of the JUI, conveyed his condolences and assured him that those who orchestrated the attack would be punished.
The US Embassy in Islamabad also condemned the attack and expressed its condolences to the families and loved ones of the victims killed in the attack..
Maulana Ziaullah, the local chief of Rehman's party, was among the dead. JUI leaders Rasheed and former lawmaker Maulana Jamaluddin were also on the stage but escaped unhurt.