The blast took place near the city of Peshawar and not far from the tribally administered regions that border Afghanistan where militants are at their strongest. The area struck is home to several tribal armies that battle the Taliban and are encouraged to do so by the government.
Police officer Zahid Khan said around 300 people were attending the funeral for the wife of a militiaman in the Matani area when the bomber struck. TV footage showed men picking up bloodied sandals and caps from a dusty, open space where mourners had gathered.
Witnesses said the bomber, who appeared to be in his late teens, showed up at the funeral just as it was about to begin.
“We thought this youth was coming to attend the funeral, but he suddenly detonated a bomb,” said survivor Syed Alam Khan.
Taliban spokesman Ahsanullah Ahsan said the insurgents targeted the militiamen because they were allied with the Pakistani government and, effectively, the United States.
“We will carry out more such attacks if they did not stop their activities,” he said via phone from an undisclosed location.
Militia commander Dilawar Khan said he would consult his fighters and local elders about whether to keep battling the Taliban, insisting that the government did not provide them with the resources they need.
Another witness, Farman Ullah, complained that there was no police security in place for the funeral.
“It was the duty of the government to provide us security, but it did not do it,” he said.
Jamal Shah, a doctor at the main hospital in Peshawar, said it had received at least 36 bodies and more than 100 wounded in the blast.
Al-Qaida and Taliban militants are waging a bloody war against the Pakistani state from their bases in the northwest. The army has launched several offensives against the militants, but has also encouraged the formation of private armies to help out in the fight.
While the ceding of authority to armed civilians has alarmed human rights groups, the state has praised the role of the militias in battling the militants or holding ground retaken from them.
Police in Peshawar said late last year that the armies in Matani were essential in stopping militant infiltration into the city.
The militiamen operate from heavily fortified compounds in the region, and have seen their influence rise. But commanders have complained they were not getting enough government help, though they claimed to have wrested Matani from militant control.
The army says it is winning the war against militants, but bombings still regularly occur in much of the country.
On Tuesday, at least 20 people were killed in a car bombing in Punjab province.