NOWSHERA, Pakistan -- When Shahid Khan started talking, his gunmen clambered onto a school's rooftop, scanning the surrounding hills with flashlights, anticipating a possible attack.
Below them, Mr. Khan, a candidate for his region's provincial assembly, addressed potential voters -- poor farmers and village traders, gathered on a cluster of rope beds outside the school, listening raptly to his promises. Then, after wolfing down snacks offered by his hosts, he abruptly left.
"They say it's not safe around here," said Mr. Khan, as he leapt into a waiting car, trailed by a bodyguard. "We'd better get going."
Electioneering has taken a dark twist in northwest Pakistan, where a concerted campaign of Taliban attacks against the main secular party is violently reshaping the democratic landscape before parliamentary elections scheduled for May 11.
In the past 10 days, militants have carried out four bombings and one grenade attack against Mr. Khan's Awami National Party, which has governed Khyber-Pakhtunkhwa Province since 2008, and whose secular ideology is repugnant to the Taliban's vision of imposing an Islamic caliphate in Pakistan.
In the worst attack, last Tuesday, a suicide bomber killed 19 people and wounded dozens in central Peshawar, narrowly missing the former railways minister, Ghulam Ahmed Bilour.
The Taliban have warned voters to stay away from rallies organized by the three main secular parties -- the Awami Party, President Asif Ali Zardari's Pakistan Peoples Party and the Karachi-based Muttahida Qaumi Movement.
But so far, they have concentrated their fire on the Awami Party, restricting its candidates' ability to campaign freely, and tilting the field in favor of more conservative parties, analysts say.
"The most effective campaign is being run by the Taliban," said Asad Munir, a retired army brigadier with the army's Directorate for Inter-Services Intelligence, who comes from the northwest. "They are holding the state of Pakistan hostage, and doing their activities as they want."
This election was never going to be easy for the Awami Party, which has already attracted sharp criticism for poor governing skills and corruption while in office -- deficiencies that analysts, and some party insiders, say will hurt it during the balloting.
But now the Taliban seem determined to wipe out the party as a political contender.
In the past five years, militants have killed 700 Awami officials and supporters, including two lawmakers and a senior minister, officials say -- more casualties than any other party in Pakistan.
In the southern city of Karachi, where the party enjoys support in ethnic Pashtun neighborhoods, about 40 activists have been killed in the past six months, effectively shutting down the party's activities there.
Now that campaigning is under way, the Awami Party's leader, Asfandyar Wali Khan -- who himself survived an attack by a suicide bomber in 2009 -- is said to be leading the campaign from the safety of the federal capital, Islamabad.
For his candidates out in the towns and villages of the northwest, campaigning has become a furtive and fearful affair.
In Nowshera, a small town 25 miles east of Peshawar, Mr. Khan holds small rallies, often at night and with little notice. He quietly sends advance teams of supporters to check out potential sites. And he is always accompanied by a contingent of private guards and regular police officers, all heavily armed.
"Every time my team leaves my house, we are not just praying for election success -- we are praying for our lives," he said as he drove down a cobblestone lane that snaked between high-walled houses.
Once peaceful, the Nowshera district, which has a substantial military presence, has been increasingly affected by Taliban violence, suffering 26 attacks in 2012 and 5 so far this year, according to the police. Last month, a car bomb explosion at a refugee camp killed 16 people and wounded 31. In February, militants assaulted a police checkpoint, and then threw grenades at a police vehicle on a major highway, killing one officer. In some towns, Taliban fighters have forced shops selling movies to close.
As he bumped through the night, driving between rallies held in courtyards and in small village squares, Mr. Khan pointed to a school that was bombed by the Taliban last year. He helped pay to have it rebuilt. "These days, you never know what can happen," he said.
Mr. Khan, a burly man with an irreverent sense of humor, did not mention the Taliban in his campaign speeches. The talk was of bread-and-butter issues, not bullets: access to drinking water, electricity and gas.
"I don't want to depress people," he said, citing increased sales of anti-anxiety medication in local pharmacies.
But such candidates are silent on delicate issues for another reason, too: they fear antagonizing local militants.
Nowshera shares a border with Dara Adam Khel, a tribal district famed for its gunsmiths, where militants have engaged in firefights with the security forces. Just a few miles away lies the infamous Akora Khattack madrasa, where several generations of Taliban leaders have received their education.
The problem is exacerbated by arguments among Pakistan's politicians about how to handle the Taliban. Mr. Khan's main rival is a candidate of Pakistan Tehreek-e-Insaf, the party of Imran Khan, the former cricket star. With his glamorous youth appeal and vocal opposition to American policies, particularly drone strikes, Imran Khan's party is expected to do well in Khyber-Pakhtunkhwa.
But critics accuse Mr. Khan of being soft on the Taliban because he advocates talks with the militants, not fighting. In a television interview on April 15, Mr. Khan said that the Taliban were bombing his opponents "because they supported America's war."
Similarly, Nawaz Sharif, the opposition leader who is a favorite to become the next prime minister, has also been measured in his criticism of militancy.
"If Imran Khan or Nawaz Sharif think this is only happening to someone else, they are mistaken," said Mr. Munir, the retired officer, referring to the attacks on secular candidates. "If they do not speak out now, their time will come later."
The Awami Party leadership has sometimes hurt its own cause. Mr. Bilour, the former minister who survived the bombing last week in Peshawar, ingratiated himself with the Taliban last year by offering a $100,000 bounty to anyone who killed an obscure American filmmaker who had released a film insulting the Prophet Muhammad.
The offer was made one day after a mob protesting the film had stormed through Peshawar, destroying several movie theaters, including one belonging to his family. But while the Taliban embraced Mr. Bilour's offer, they ultimately offered little protection.
In December, the militants killed his brother Bashir Bilour, a politician; after last week's attack, the militants said they had intended to kill Mr. Bilour's nephew, who is standing for election in his father's election district.
After his recent night of campaigning in Nowshera, Mr. Khan, the Awami candidate, reached his home at midnight, finally relaxing over a cigarette and a cup of tea. This election was never going to be easy, he admitted -- voters were already skeptical of corruption in politics, and his opponent, a doughty veteran of several elections, would be tough to beat.
But since the Taliban entered the fray, his odds had slimmed even further. "I want to make a difference," he pleaded. "But like this, our hands are tied."
Ismail Khan contributed reporting from Peshawar, Pakistan.
This article originally appeared in The New York Times.