PESHAWAR: A suicide bomber targeted a mosque in Mohmand Agency's Anbar tehsil during Friday prayers, leaving at least 24 people dead and 31 others injured, official of the political administration said.

Assistant Political Agent Naveed Akbar told DawnNews that the injured had been transported to hospitals in Bajaur Agency, Charsadda and Peshawar for treatment.

The bombing took place in the village of Butmaina in the Mohmand tribal district bordering Afghanistan, where the army has been fighting against Taliban militants.

Akbar said that the bomber came in as Friday prayers were in progress and blew himself up in the main hall. A curfew was later imposed in the area.

Another local government official confirmed the information.

Shireen Zada, a resident who had prayed at another mosque, said he heard the blast as he was walking home.

“I rushed to the spot and when I went inside the hall there was blood and human remains everywhere and people crying out,” he said.

“I brought my pick-up truck, loaded three wounded and drove them to the hospital in Khar,” Shireen Zada said, referring to the nearest town.

Prime Minister Nawaz Sharif later condemned the bombing, saying the government would remain steadfast in their fight against extremists.

“The cowardly attacks by terrorists cannot shatter the government's resolve to eliminate terrorism from the country,” read a statement from Nawaz Sharif's office.

Jamaatul Ahrar, an offshoot of the Tehrik-i-Taliban Pakistan (TTP), claimed responsibility of the attack.

On September 2, at least 14 people were killed and more than 50 wounded after a suicide bomber attacked a court in Mardan in an assault targeting legal community that was claimed by the Jamaat-ul-Ahrar Taliban faction.

The group has also said it was behind an attack on lawyers in southwest Quetta, which killed 73 people on August 8, as well as the Lahore Easter bombing that killed 75 in the country's deadliest attack this year.

Pakistani Taliban in particular routinely attack soft targets such as courts, schools and mosques.

The army launched an operation in June 2014 in a bid to wipe out militant bases in the northwestern tribal areas and so bring an end to the bloody insurgency that has cost thousands of civilian lives since 2004. Security has since improved though scattered attacks still take place.