PESHAWAR, Pakistan — A suicide bomber blew himself up in a crowd of hundreds of mourners attending a funeral in northwestern Pakistan on Tuesday, killing 29 people. Among the dead was a newly elected lawmaker who may have been the target, authorities said.
The blast was the deadliest attack in the region since May 11 national and regional elections installed a new government in the northwestern province of Khyber Pakhtunkhwa.
The carnage poses a challenge for cricketer-turned-politician Imran Khan, whose party won the provincial election there on a platform of negotiating with the Pakistani Taliban to bring an end to the years of fighting and attacks.
The bombing in the village of Sher Garh near the city of Mardan also wounded at least 57, said Tahir Ayub Khan, a senior police officer in Mardan.
Many of the wounded were taken to hospitals in the provincial capital of Peshawar, about 40 miles away.
Speaking as doctors were examining him, Azeem Khan said a local cleric was leading the funeral prayers when he heard a deafening explosion and was knocked to the ground.
‘‘People were running away for safety,’’ he said. ‘‘Mourners at the funeral were crying for help after the blast.’’
Another eyewitness told Pakistan’s Dunya television that 700 to 800 people were attending the funeral when the explosion occurred.
The lawmaker Imran Khan Mohmand ran in Pakistan’s May 11 elections as an independent candidate and later supported the party of Imran Khan, the former cricket player. He was the second provincial lawmaker affiliated with the party to be killed since the election.
The other lawmaker, also an independent who later joined Khan’s party, was shot dead this month.
The Pakistani military has been fighting to root out Pakistani Taliban and affiliated militants from the tribal areas, a region that borders Afghanistan. The militants have vowed to overthrow the government and have carried out a campaign of bombings and shootings, mostly in the northwest, that have killed tens of thousands of civilians and security forces in recent years.
Khan campaigned on an anti-American platform in which he blamed the CIA’s drone program and the war in Afghanistan for leading to much of the violence in Pakistan. He also favored negotiations with the Pakistani Taliban instead of military operations against them, and many of his aides and supporters said the party would not allow Pakistan to be used to ferry supplies to and from NATO troops in Afghanistan.