Initially, Buner was a hard place for the Taliban to crack. When they attacked a police station in the valley district last year, the resistance was fearless. Local people picked up rifles, pistols and daggers, hunted down the militants and killed six of them.

But it was not to last. In short order this past week the Taliban captured Buner, a strategically vital district just 60 miles northwest of the capital, Islamabad. The militants flooded in by the hundreds, startling Pakistani and American officials with the speed of their advance.

That Buner fell should be no surprise, local people say. Last fall, the inspector general of police in North-West Frontier Province, Malik Naveed Khan, complained that his officers were being attacked and killed by the hundreds.

Mr. Khan was so desperate — and had been so thoroughly abandoned by the military and the government — that he was relying on citizen posses like the one that stood up to the Taliban last August.

Today, the hopes that those civilian militias inspired are gone, brushed away by the realization that Pakistanis can do little to stem the Taliban advance if their government and military will not help them.

The peace deal the military struck with the Taliban in February in neighboring Swat further demoralized people in Buner. Residents and local officials said they asked themselves how they could continue to resist the Taliban when the military had abandoned the effort. The Taliban were emboldened by the deal: it called for the institution of Shariah, the strict legal code of Islam based on the Koran, throughout Malakand Agency, which includes Swat and Buner. It allowed the Taliban amnesty for their killings, floggings and destruction of girls schools in Swat.

Still, when the Taliban rolled into Buner from Swat through the town of Gokan on April 5, a well-to-do businessman, Fateh Mohammed, organized another posse of civilian fighters to take on the militants in the town of Sultanwas.

Five civilians and three policemen were killed, he said. Some newspaper reports said 17 Taliban were killed.

At that point, the chief government official in charge of Malakand, Mohammed Javed, proposed what he called peace talks. Mr. Javed, an experienced bureaucrat in the Pakistani civil service, was appointed in late February as the main government power broker in Malakand even though he was known to be sympathetic to the Taliban, a senior government official in North-West Frontier Province said. The government had been under pressure to bring calm to Swat and essentially capitulated to Taliban demands for Mr. Javed’s appointment, the official said.

In what some residents in Swat and now in Buner say had been a pattern of favorable decisions led by Mr. Javed on behalf of the Taliban, the talks in Buner turned out to be a “betrayal,” said a former police officer from the area, who was afraid to be identified.

To bolster their strength, and insinuate themselves in Buner, the Taliban also relied heavily on the adherents of a hard-line militant group, the Movement for the Implementation of the Shariah of Muhammad, which has agitated for Islamic law in Pakistan.

Their leader, Sufi Mohammed, comes from the region around Swat and Buner and has whipped up local support and intimidated Taliban opponents.

With their success in Buner, the Taliban felt flush with success and increasingly confident that they could repeat the template, residents and analysts said. In the main prize, the richest and most populous province, Punjab, in eastern Pakistan, the Taliban are relying on the sleeper cells of other militant groups, including the many fighters who had been trained by the Pakistani military for combat in Kashmir, and now felt abandoned by the state, they said.

It would not be difficult for the Taliban to seize Peshawar, the capital of North-West Frontier Province, by shutting down the airport and blocking the two main thoroughfares from Islamabad, a Western official with long experience in the province said.

At midweek, a convoy of heavily armed Taliban vehicles was seen barreling along the four-lane motorway between Islamabad and Peshawar, according to Mr. Sherpao, the former minister of the interior.

the BBC's Syed Shoaib Hasan in Islamabad says circumstances suggest the militants are now under pressure and that a national consensus is building among the public and political parties that they must be challenged with force.