At a village mosque, a leaflet printed in neat Pashto script was found last week, instructing "all good Muslim citizens" to stay away from government buildings, foreign troops and official funerals. If anyone disobeyed, the pamphlet warned, "your bodies will join theirs."

At a university compound, a group of armed and masked men recently broke into the home of a teacher active in promoting women's voting rights, threatening to kill her if she resumed her activities. She is now guarded by soldiers at home and en route to work.

"Elections are new and unfamiliar here. People are uneducated, so others can deceive them and make them do destructive things," said Sahira Zadran, 40, the teacher. "We have two problems: culture and terrorism. Culture may take time to change, but it can't kill you. Terrorists can kill you."

As Afghanistan prepares to hold its first elections in September, a flurry of attacks by armed Islamic groups on aid workers, election preparation teams and foreign troops have raised concerns that anti-democratic forces will sabotage the vote, stymie Afghanistan's economic progress and undermine its relations with the West.

On Wednesday, three Europeans and two Afghans working for the French medical aid group Doctors Without Borders were ambushed and assassinated in the western province of Badghis. Doctors Without Borders suspended its operations in the country on Thursday, the Associated Press reported. Spokesmen for the Taliban movement claimed it had carried out the killings, the deadliest attack on foreign aid workers since the Taliban's radical Islamic rulers were ousted in late 2001.

In other violence during the past weeks, four U.S. Special Forces troops were killed in a firefight in Zabol province; a senior Afghan security official was killed by a bomb in his office; two Afghan election workers were wounded by a remote-control bomb in Nangahar province; and two British election workers were ambushed and killed in Nurestan province.

U.N. officials have repeatedly cited the lack of security as the major obstacle to holding successful elections. Despite plans to deploy 10,000 newly trained soldiers and 20,000 police officers across the country, possibly augmented by hundreds of NATO troops, officials are increasingly concerned that they will not be able to protect voters from intimidation, abuse and attacks.

In Khost, officials have an important advantage in clearing the way for elections: The region's ethnic Pashtun tribes are unusually unified and supportive of the democratic process. With army and police forces stretched thinly across the mountainous eastern province, tribal militias are guarding isolated voter registration sites.

But other factors are working against a successful, violence-free election. One is geography: Khost shares a 100-mile border with Pakistan's tribal areas, which Islamic fighters use as a haven. The other is culture: Khost is an especially conservative region, where women are never seen in public and some men oppose allowing them to vote.

"The people are enthusiastic, but our enemies are not asleep," said Pir Syed Shah, a religious leader who heads the provincial election office in the city of Khost. "Our opponents don't want development and democracy, especially for women, but they cannot stop this process."

Quoting an Afghan proverb, he said: "The sound of their lightning is much worse than the strength of their rain."

Khost is a province in mid-storm -- an isolated, deeply traditional area that has undergone a rapid but superficial transformation. Until 2001, it was a stronghold of the Taliban and home to several of the movement's senior commanders. Even today residents regularly visit a cemetery for Arabs and other foreign allies of the Taliban who were killed by U.S. bombs. Hundreds of scarves have been strung over the tombs by Muslims seeking blessings from these people, who are viewed as Islamic martyrs.

Yet Khost city, the provincial capital, is also home to a year-old university full of progressive students and professors who have brought new ideas from Kabul or from their lives as exiles abroad. Provincial officials, named by the U.S.-backed government of President Hamid Karzai, are more in tune with its reformist agenda than cities in other border regions where regional militia leaders defy central authority.

Many Muslim clerics in Khost initially opposed the elections, especially the participation of women as voters or candidates. But last month, the governor called a meeting of Muslim scholars and clergy at the university. After lengthy discussions they agreed to issue a religious edict supporting the elections.

Since voter registration began one month ago, 18 sites have opened and 32,000 people have obtained voter cards, joining more than 3 million Afghans who have registered nationwide. But as the process gathers steam, both internal and external opposition has become bolder, while the anti-foreign, anti-election message from Islamic extremist groups has found some popular resonance.

This week, U.N. election monitoring teams were confined to their urban compound after U.N. officials received letters threatening to kill or kidnap U.N. workers in Khost. Leaflets found in mosques, meanwhile, warned residents not to go near foreign troops or facilities, threatening hundreds of Afghans who work with the United Nations and other agencies.

"The process has been very disheartening," said one frustrated worker. "We need to be talking with people, but we cannot get out to the new sites for proper supervision. You can't force people to register, and you do not get good results when you conduct an election in an atmosphere of insecurity."

Even within families, the tensions between old and new ways of thinking can lead to confrontation. Sharif Zadran, who teaches history at Khost University and is married to Sahira, said he was proud of his wife's efforts to promote voting among women but had come under considerable pressure from his relatives to stop her high-profile activism.

"Tradition is a very hard thing to fight, and I have stepped on tradition by allowing my wife to work in public," said Zadran, a Khost native who returned here to teach last year after spending years in Pakistan and the Afghan capital, Kabul. "Now we have people breaking into our house at night, and even my cousins are speaking against me."

As the voter registration program reaches farther into the hills and hollows of Khost, the tugs of tradition and change are being played out in complex and sometimes creative ways. Community leaders realize that more voters will mean more economic and political benefits, but they must also ensure that women do not bring shame on their communities when they take part.

In the mountain district of Musakhel, dozens of robed and turbaned village men flocked Monday morning to have pictures taken and plastic ID cards made the day after a new voter registration site was set up at a tiny gas station.

Across the road and up a dirt path, the women of the village gathered in a farmhouse, affixing thumbprints to their voter cards. The photo squares were left blank. An 18-year-old woman, one of the few literate females in the area, copied down their names and approximate ages. Then a male election official carried the cards 50 yards to the gas station to be registered.

"We all want the chance to choose our leaders. The tribe is with us, and the tribe will defend us if we are attacked," said Sayed Kamal, a village elder and election team leader. "We want our women to vote, too, so we made this special arrangement. If they cross that main road and some strange driver sees them, people would talk."

In districts nearer the Pakistan border, officials trying to organize elections face more menacing obstacles. Small groups of fighters sneak across the hills from Pakistan, launch ambushes or rocket attacks and slip away in the night. Usually no one is killed, but a sense of insecurity persists.

At a police station in the Ghor Buz district Tuesday, officials pointed to a window shattered by a rocket fired from a nearby ditch two nights before. But a crowd of community elders gathered outside seemed undaunted by such attacks as they discussed plans to promote and protect voter registration.

"These people come from Pakistan like thieves in the night. They want to keep Afghanistan from getting ahead," said Hakim Mahmad, 55. "But we have been waiting years for elections. We will not let anyone pressure us -- not Taliban, not al Qaeda, not warlords, nobody. We want our children to use pens instead of weapons, and only elections can bring that."

Mullah Zalmai, a religious leader in Khost province, has a photograph taken for his voter registration card. Although Khost is isolated and deeply conservative, its ethnic Pashtun tribes are united in support of the democratic process.