The blast on Friday occurred in Akora Khattak, a district in Khyber Pakhtunkhwa province, district police chief Abdul Rashid said.
He said Hamidul Haq, who is the head of a faction of the Jamiat-e-Ulema Islam (JUI) party, is also among the dead.
Rashid said officers were investigating, and the dead and wounded are being transported to hospitals.
The slain cleric Haq is the son of Maulana Samiul Haq, known as the "father of the Taliban", who was killed in a knife attack at his home in 2018.
Haq's family confirmed he was killed in Friday's attack and appealed to his followers to remain peaceful.
Haq was also in charge of the Jamia Haqqania seminary, where many Afghan Taliban had studied in the past two decades.
Pakistan's Prime Minister Shehbaz Sharif condemned the attack and ordered authorities to provide the best possible treatment to the wounded.
Zulfiqar Hameed, the provincial police chief, said the attack was apparently a suicide bombing, but bomb disposal experts were still investigating.
No group has immediately claimed responsibility.
Hameed said Haq was the target of the attack.
The bombing came before the Muslim holy month of Ramadan, which is expected to start either on Saturday or Sunday subject to the sighting of the crescent moon.
Pakistan has witnessed a surge in attacks in recent years.
As many as 101 people, mostly police officers, were killed in 2023 when a suicide attack targeted a mosque in Peshawar, the capital of the Khyber Pakhtunkhwa province.
Pakistani authorities have blamed the Pakistani Taliban, who are known as Tehreek-e-Taliban Pakistan or TTP, for the previous most of the attacks.
TTP never claimed attacks on mosques, saying it does not target places of worship.
TTP is a separate group but an ally of the Afghan Taliban, who seized power in neighbouring Afghanistan in August 2021 as US and NATO troops were in the final stages of their pullout from the country after 20 years of war.
Many TTP leaders and fighters have found sanctuaries and have even been living openly in Afghanistan since the Taliban takeover, which also emboldened the Pakistani Taliban.