At least 25 people are dead in northwestern Pakistan, after a suicide bomber shouted "Allahu akbar" and blew himself up in a packed mosque, a local official says.
At least 30 other people were wounded in the attack during Friday prayers.
No group immediately claimed responsibility for the bombing in Payee Khan, a village in Mohmand Agency that is part of the lawless Federally Administered Tribal Areas (FATA) bordering Afghanistan.
"The suicide bomber was in a crowded mosque, he shouted 'Allahu akbar' (God is greatest) and then there was a huge blast," Naveed Akbar, deputy administrator of Mohmand Agency, told Reuters.
Akbar added that some fatalities appear to have been caused when part of the mosque caved in from the force of the blast.
Pakistan Prime Minister Nawaz Sharif condemned the bombing and said the "attacks by terrorists cannot shatter the government's resolve to eliminate terrorism from the country".
Local tribal elder Haji Subhanullah Mohmand said the attack may have been carried out by Islamist militants seeking revenge after local tribesmen gathered a volunteer force and killed one and captured another insurgent.
Pakistan's frontier regions, which are deeply conservative and hard to access due to rough terrain, have long been the sanctuary of fighters from al-Qaeda, the Taliban and other militant groups.
In 2014 the army launched a major operation in other parts of FATA including North and South Waziristan against insurgents who routinely attacked government officials and civilians.
Security in Pakistan has improved in recent years - the military says "terrorist incidents" dropped from 128 in 2013 to 74 last year - but Islamist extremists continue to stage major attacks.
A bombing of lawyers in the city of Quetta killed 74 people last month, an attack claimed by both the Islamic State and Jamaat-ur-Ahrar, a breakaway faction of the Pakistani Taliban.
Jamaat-ur-Ahrar also claimed the Easter Sunday bombing in a park in the eastern city of Lahore that killed 72 people, many of them children.