The death toll from a suicide bomb at a crowded mosque in northwestern Pakistan, the country's deadliest attack for three months, rose to 51 on Saturday, officials said.

A suicide bomber detonated himself as more than 500 people packed into a mosque for Friday prayers in Jamrud town in the lawless Khyber tribal district, killing many instantly and wounding scores more.

"The death toll has risen to 51 and 121 people were wounded," local government official Khalid Mumtaz Kundi said. "Sixty-one of the wounded are still in hospital."

Blood was splattered across the mosque's main hall and walls, while the building's doors and windows were destroyed and its ceiling fans mangled by the blast.

Ball bearings used in the suicide vest were also scattered across the mosque which lies 16 miles (25 kilometers) from Peshawar, the main city in the Khyber tribal district where much of the violence in Pakistan is concentrated.

Friday's bomb was the deadliest since May 13 when two suicide bombers blew themselves up outside a police training center in a town outside Peshawar, killing 98 people.

A little known militant spokesman who identified himself as Mohammad Talha claimed responsibility on behalf of the umbrella militant group, Tehreek-e-Taliban Pakistan (TTP).