At least 25 people have been killed in a suicide bombing claimed by a Taliban splinter group at a mosque in Pakistan.

The blast struck as Muslims gathered for Friday prayers in the village of Payee Khan in Mohmand Agency district.

“The suicide bomber was in crowded mosque, he shouted 'Allahu Akbar', and then there was a huge blast,” Naveed Akbar, deputy administrator of the region, told Reuters.

Pakistan: Quetta blast targets lawyers at hospital

Officials said at least 25 people were killed and 30 injured and there were fears the death toll could rise as rescue operations continued.

Pakistani Taliban faction Jamaat ul-Ahrar claimed responsibility for the attack, with local tribal elder Haji Subhanullah Mohmand suggesting it may have been revenge for the killing of a militant by tribal volunteers.

“It seems to have enraged the militants and they got their revenge by carrying out a suicide attack in a mosque today,” he said.

Nawaz Sharif, the Prime Minister of Pakistan, condemned the bombing and said “attacks by terrorists cannot shatter the government's resolve to eliminate terrorism from the country.”

The military says security is improving, with recorded “terrorist incidents” dropping from 128 in 2013 to 74 last year - but Islamist extremists continue to stage major attacks.

In pictures: Pakistan hospital attack Show all 10 1 /10 In pictures: Pakistan hospital attack In pictures: Pakistan hospital attack A man reacts after his relative was killed in a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack Residents light candles to honour victims of the blast in Quetta during a candellight vigil in Peshawar Reuters In pictures: Pakistan hospital attack People carry the coffin of a victim of suicide bomb attack at a hospital for burial in Quetta REUTERS In pictures: Pakistan hospital attack Pakistani victims injured in a suicide bombing are treated at a hospital in Quetta AFP/Getty Images In pictures: Pakistan hospital attack A lawyer who was injured in a bomb blast wait to receive medical treatment in restive Quetta EPA In pictures: Pakistan hospital attack A doctor treats an injured lawyer at the scene of a bomb blast in restive Quetta EPA In pictures: Pakistan hospital attack People comfort a man mourning the death of a family member who was killed in suicide bombing, at a funeral in Quetta AP In pictures: Pakistan hospital attack People transfer an injured man from the blast site in Quetta Rex Features In pictures: Pakistan hospital attack Pakistani security officials and lawyers gather around the bodies of victims killed in a bomb explosion at a government hospital premises in Quetta AFP/Getty Images In pictures: Pakistan hospital attack The scene following a bomb blast outside a hospital in Quetta Naseer Ahmed/Reuters

Friday's bombing came a day after a woman was killed by a grenade in Lower Mohmand Agency when militants attacked a pro-government tribal elder's home.

Mohmand lies in Pakistan's Federally Administered Tribal Areas, a semi-autonomous tribal region bordering Afghanistan.

Largely deeply conservative, the territory is remote and hard to access, providing sanctuary for extremist fighters targeted in decades of military operations and drone strikes.

Tehrik-i-Taliban (Pakistani Taliban) militants are waging an Islamist insurgency in the area and have launched a series of bombing attacks and assaults on security services.

Its Jamaat ul-Ahrar faction claimed responsibility for a bombing targeting lawyers that killed 74 people in the city of Quetta last month, as well as the the Easter Sunday blasts in Lahore that killed 72 people, many of them children.