A bomb has exploded at a mosque in north-western Pakistan during Friday prayers, killing at least 38 people and wounding dozens more.
Police said a suicide bomber detonated explosives at the mosque in Upper Dir district, although some witnesses said the bomb was already in the building.
Nearby Swat Valley has been the scene of heavy fighting between the Pakistani military and Taliban militants.
Upper Dir has also been the scene of sporadic clashes between the two.
The bomb exploded at the mosque in the village of Hayagai Sharki, about 15km from the town of Upper Dir.
The building was severely damaged and many worshippers were reported to have been trapped under the rubble. A resident of the village described the carnage at the scene of the blast.
"A large number of body parts are scattered in the mosque. We don't know whether these are parts of the dead who have been identified or of others," Umer Rehman told the Reuters news agency.
There has been no immediate claim of responsibility for the blast, but the north-west region as a whole has witnessed a number of suicide attacks linked to the Taliban insurgency, as well as the Shia-Sunni sectarian divide.
Condemnation
In March, about 50 people died in a suicide bomb attack at a mosque near Jamrud, on the Khyber Pass route to Afghanistan.
There are fears of a militant backlash in response to the army's military campaign in Swat, analysts say.
The bombing has been condemned by both the Pakistani president and the prime minister who have reiterated Pakistan's determination to establish full government control.
Pakistan's army chief, General Ashfaq Kayani, said in a statement last night that the army had "turned the tide" against the Taliban and reiterated that the army aimed to completely eradicate them from the neighbouring Swat valley.
In recent days the army has captured a number of militant strongholds as it continues its offensive.
More than two million people have been displaced by the fighting.
A bomb blast at a mosque in northwestern Pakistan is suspected to have killed at least forty people on Friday.

According to police reports, the explosion happened in a village located in the  district of the . The incident occurred while worshipers were offering the Friday prayers. 

"Around 40 people are killed. We have no idea as yet how many have been wounded," said Atif-ur-Rehman, a senior government administrator of Upper Dir.

The mosque was damaged heavily by the explosion, and many people have been trapped under debris.

"A large number of body parts are scattered in the mosque. We don't know whether these are parts of the dead who have been identified or of others," said Umer Rehman, one of the village's residents, to the Reuters news agency.

This is the ninth bomb blast in Pakistan since the country's armed forces started attacks against the Taliban in the nearby  valley from the past few months, in an attempt to force the fighters out of the area.

  and   both condemned the attack. The London-based  chief, , has also condemned the blast.