ISLAMABAD, Pakistan — Four months ago, the people of the Pakistani mountain village of Shalbandi gained national repute after a village posse hunted down and killed six Taliban fighters who had tied up and killed eight local police officers. The posse displayed the Taliban corpses like trophies for other residents to see, and the village was celebrated as a courageous sign that the Taliban could be repelled.
On Sunday morning, the Taliban struck back.
A suicide car bomber set off an explosion at a school in Shalbandi that was serving as a polling place, as voters lined up to elect a representative to the National Assembly. More than 30 people were killed and more than two dozen wounded, according to local political and security officials. Children and several police officers were among the dead.
The attack was the latest demonstration of the Taliban's bloody encroachment eastward and deeper into Pakistan from the lawless tribal areas on the western border. Shalbandi is less than 100 miles northwest of Islamabad, the capital, and lies just south of the lush Swat Valley, a onetime ski resort known as the "Switzerland of Pakistan" that has been largely taken over by the Taliban despite large-scale army operations.
In the frenzied aftermath of the car bombing, survivors and witnesses offered conflicting accounts of the attack, said Mian Iftikhar Hussain, information minister for the North-West Frontier Province, where Shalbandi is located.
In one version, he said, the bomber sped his car toward the school but plowed into adjacent shops. The explosion was so large that it destroyed part of the school and killed many people waiting to vote. In the other version, he said, the killer parked near the school and told people he was having car trouble. As people gathered, he detonated the bomb inside.
"He pretended his car was not working, then he asked for help, people came and tried to push it, and then it blew up," Mr. Hussain said. It was not clear which account was more accurate.
A Taliban spokesman claimed responsibility for the attack as retribution for the deaths of six fighters, according to a Pakistani news channel.
The Pakistani military reported over the weekend that it had killed 34 militants in Swat, just north of Buner, the district that includes Shalbandi. But the choice of Shalbandi for the attack left little doubt which six deaths the Taliban had sought to avenge.
"They singled out this village because it had clearly resisted and had expelled the Taliban by force," said Afrasiab Khattak, head of the Awami National Party in the province, which now leads the provincial government after defeating incumbent religious parties with ties to militants in February elections.