The attack came during the holy month of Ramadan, a time of fasting, sharing and heightened community spirit for Muslims.
No group immediately claimed responsibility, but the Taliban and other Islamist militants have previously targeted mosques, especially if they believe enemies - such as army soldiers or anti-militant tribesmen - are using the facilities.
The mosque hit Friday is in Ghundi, a village in the Khyber tribal region, a part of Pakistan's tribal belt. Khyber has long been a base for Islamist militants, and the Pakistani army has waged multiple operations aimed at pacifying the region but with limited success.
Khyber also is a key region for the U.S. and NATO, because a large portion of non-lethal supplies heading to U.S. forces in Afghanistan passes through it.
Some 300 people had gathered for prayers Friday afternoon in the Sunni mosque, and many were on their way out when the explosion occurred, local administrator Iqbal Khan said.
"All the evidence we have gathered confirms that it is a suicide attack," said Fazal Khan, another local official who also confirmed the casualty figures. He said witnesses alleged the bomber was a young man.
Saleem Khan, 21, said people panicked after the blast, and that amid the smoke, cries and blood, several ran over him when he fell.
"Whoever did it in the holy month of Ramadan cannot be a Muslim," he said from a hospital bed in the main northwest city of Peshawar. "It is the cruelest thing any Muslim would do."
TV footage from the scene showed a heavily damaged building. Prayer caps, shoes and green prayer mats were scattered across a blood-splattered floor, while ceiling fans were twisted and walls blackened. Men comforted a young boy who wept as he held his hand to his heart.
The attack appeared to be the deadliest since twin bombings in mid-June killed around 40 people in Peshawar. That attack was believed to be part of a wave of bombings staged by militants to retaliate over the U.S. killing of al-Qaida chief Osama bin Laden in May.
The Pakistani Taliban and their affiliates stage attacks in Pakistan because they oppose Islamabad's alliance with the United States.
Also Friday, two U.S. missiles struck a house in a tribal region that was once a Pakistani Taliban stronghold, killing four people, intelligence officials said.
The strike came as Pakistani-U.S. relations are struggling since the unilateral American raid that killed bin Laden in the northwest Pakistani garrison town of Abbottabad. The continued missile attacks, which Pakistan officially opposes, suggests Washington considers the tactic too valuable to give up.
Though Pakistan objects to the covert, CIA-run missile program, it is believed to have aided it at times. The U.S. rarely acknowledges the program.
The two missiles hit a house Friday in Sheen Warsak village in the South Waziristan tribal area, according to two Pakistani intelligence officials who spoke on condition of anonymity because they were not authorized to speak to reporters.
The identities of the dead were not immediately clear. Although U.S. officials insist the vast majority of victims in the strikes are militants, Pakistanis and some human rights activists have said civilians are often caught up in the attacks.
South Waziristan is a lawless stretch of rugged territory that was largely under the control of the Pakistani Taliban until October 2009, when the country's army launched an operation against the insurgents. However, militant activity is still occasionally reported in the region.
It is nearly impossible to independently verify the information from the region because access is heavily restricted.
Associated Press writers Asif Shahzad and Rasool Dawar contributed to this report from Islamabad.