LANDI KOTAL, Pakistan (Reuters) -- A suicide bomber killed 37 people when he blew himself up in a crowded Pakistani mosque near the Afghan border, government officials said.

The attack came hours before U.S. President Barack Obama announced a new strategy for the Afghan war, an approach U.S. officials said would also recognize Pakistan as a key part of the conflict.

Militant violence has surged in nuclear-armed Pakistan since mid-2007, with numerous attacks on the security forces and government and Western targets.

Police, paramilitary forces, and government officials were among the congregation in the mosque near Jamrud town, about 30 kilometers from the Afghan border, when the attack happened.

The bomber set off his explosives as an imam, or prayer leader, began the service.

"The moment the imam said Allahu Akbar, the blast went off," said Tauseer Khan, 70, from a hospital bed in the nearby Pakistani city of Peshawar.

"It was huge. I still can't hear properly," said Khan, who had wounds to his hands and face. His son and grandson were also wounded.

Rahat Gul, a spokesman for the Khyber administration had earlier said 50 people had been killed and 75 wounded but Tariq Hayat Khan, Khyber's top government administrator later revised the death toll to 37.

Among the dead were 14 policemen and paramilitary soldiers while 160 were wounded, Khan said.

Between 250 and 300 people were in the mosque at the time of the blast, he said.

"The attacker was seen jumping into the courtyard of the mosque and blowing himself up," Khan told Reuters.

The two-storey building collapsed.

Worshippers and rescuers searched through piles of bricks, pulling out bodies, and carrying them to ambulances in sheets and on rope beds.

Police caps, prayer caps, prayer beads, and mobiles telephones were later lined up on a wall outside the mosque. Rows of abandoned shoes were nearby.

'Enemies Of Islam'

Police initially said a bomb blew up at a police post next to the mosque, which is by the main road leading to the Khyber Pass and the Afghan border beyond.

Pakistani Taliban militants last year stepped up attacks on supplies going through the pass bound for Western forces in landlocked Afghanistan.

Since mid-2007, much of the violence in Pakistan is believed to have been carried out by militants based in lawless ethnic Pashtun lands on the Afghan border.

In Afghanistan, the Taliban have also sharply escalated their attacks, often operating from the same strongholds in Pakistan.

Obama's new strategy will aim to disrupt, dismantle and eventually destroy militant sanctuaries in Pakistan and prevent them from establishing safe havens in Afghanistan.

"It's surprising, those who claim that they are doing jihad (Muslim holy war) and then carry out suicide attacks inside mosques during Friday prayers," Khan told Geo TV.

"They are infidels. They are enemies of Pakistan. They are enemies of Islam," he said.

On March 26, a suicide bomber killed nine people at a restaurant frequented by militants opposed to a top Pakistani Taliban commander in the South Waziristan region, southwest of Khyber.