-- Standing in a garbage-clogged alley that runs through his community of 25 years, Tor Mahmad, an Afghan refugee, shooed away a gaggle of shrieking, grime-streaked children and slowly contemplated a new idea.

"Yes, I would like to vote," said Mahmad, 50, a gray-bearded night watchman. "Back in my country there is no law or government and in this one we have no roots or respect. I have not heard much about this election, but maybe if they bring in a real government there, we can all go home."

Then Mahmad paused and glanced at a doorway where several Afghan women were listening, half-hidden behind bright scarves. "But they won't vote," he added firmly, shaking his head. "In our tradition, women do not go beyond their walls."

With less than six weeks to go before Afghanistan holds its first-ever presidential election, officials are just beginning to face the monumental task of locating, informing and registering up to several million eligible voters who live beyond the country's borders in Pakistan and Iran.

The challenges are daunting, to say the least. There are no reliable estimates of the number of refugees, a population that has shifted and dwindled in recent years. In Iran, most are formally documented, but in Pakistan very few have proper identification.

The election has received widespread publicity in Afghanistan and nearly 10 million voters have already been registered. But little information has circulated in Afghan refugee communities -- no radio ads urging people to sign up, no cheerful cartoon posters showing women and men casting ballots.

The government in Kabul had not made a final decision about whether refugees should vote until several months ago, after much wrangling among Afghan and U.N. officials. Voter registration went very slowly at first in Afghanistan, turning the large refugee populace into a potentially powerful electoral tool with major implications for the ethnic balance among voters, according to sources.

Pakistan is home to perhaps 1.5 million refugees, most of whom are ethnic Pashtuns and Sunni Muslims. This is the group to which Afghan President Hamid Karzai -- already the election front-runner -- belongs. In Iran, there are about 800,000 refugees, almost all of them Shiite Muslims from Afghanistan's smaller ethnic Tajik and Hazara groups, which have fielded rival candidates.

"People thought a huge percentage of the voters would be outside, so it was a very sensitive and difficult discussion," said an official with the U.N.-sponsored program to process refugee voters in both countries. "This is already one of the most quickly conducted elections in post-conflict history. The decision about the out-of-country vote was made very late, and the time frame is extremely short."

Even after the in-country registration rolls swelled and Afghan officials decided to allow refugees to vote, agreements had to be reached with the Iranian and Pakistani governments about allowing foreign nationals to vote on their soil. This was a delicate undertaking, officials said. Both countries are eager to push refugees out, and there were concerns that Pakistan, which has never formally registered refugees, might use the voter documentation process as a way to locate or pressure individuals to leave.

Only now that all the agreements are in place can election preparation begin. Recently, the U.N.-sponsored International Organization for Migration began hiring several hundred teachers and other educated Afghans at its office in this northwest Pakistani city near the Afghan border. They will soon be sent out in pairs to refugee camps and communities to promote the elections.

Then, during the first three days of October, they will register as many eligible voters as possible at more than 1,000 election stations set up in 300 locations. In Iran no advance registration will be necessary, and refugees will be able to vote Oct. 9 by presenting their refugee ID cards.

On Thursday, after their first day of briefings here, the new election "mobilizers" seemed enthused but concerned. How would they determine if someone without identification was over 17 and a true refugee? How would they convince conservative, illiterate Pashtun men that their wives and other female relatives should be allowed to vote?

"Men who are not educated will create problems for us, especially in the camps," said Zarmina, 36, a female teacher who will be helping to get out the refugee vote. "They will be suspicious that we are trying to contact their women. We will just have to do our best to meet with them and convince them that this is the right thing to do." Like many Afghans, Zarmina identified herself by one name.

Among refugees, word of the upcoming election has spread erratically through the mud-walled villages, tented camps and cramped urban apartments of greater Peshawar where, since the early 1980s, successive waves of Afghans have found shelter from Russian occupation, civil war, religious persecution and drought in their homeland.

In Nasir Bagh, one of the oldest refugee settlements on the outskirts of the city, most men seemed to have heard about the presidential contest and said they planned to vote, if allowed to do so. But some expressed skepticism about whether the process would be fair, and others said they feared their community would be vulnerable to attacks from revived forces of the Taliban, the Islamic movement that ruled most of Afghanistan from 1996 to 2001 and has now vowed to disrupt polling.

"The Taliban are openly threatening the elections. We all want to have a say and a share in choosing the government, but we want security too," said Azizullah, 40, a doctor and longtime community leader, whose tiny clinic in Nasir Bagh is decorated with bright paper flowers. "If the Pakistan government makes proper arrangements for security, it will be fine. But if there are terrorist attacks on the elections here, the government will blame us."

Taliban fighters and other extremist groups are widely believed to have found refuge in the Pashtun tribal areas of Pakistan along the Afghan border, and some are said to operate from certain refugee camps. U.S. and Afghan officials have criticized Pakistan for not pursuing them more vigorously, but recent efforts by the Pakistani army to dislodge extremist militants from the northwest tribal region met with strong popular resistance.

In Kabul, meanwhile, presidential candidates expressed concern that they would not be given the physical protection or the diplomatic access needed to visit refugee camps and make themselves known to a long-absent population that has heard of Karzai but knows about few of his rivals.

"All of us should be given an opportunity to visit with our countrymen in Pakistan and spread our message, but so far we have had no access to refugees, and there is not much time left," said Homayoun Shah Assefy, 64, a lawyer who is challenging Karzai at the polls.

Although the United Nations already faces a major challenge in trying to register hundreds of thousands of first-time voters within three days, some Afghan groups have criticized countries for not reaching out to refugees. There will be no registration centers in major Pakistani cities such as Karachi and Lahore, where thousands of Afghans live; outreach will focus on the heavier refugee concentrations around the border cities of Peshawar and Quetta.

Officials pointed out that refugees in the other cities may still "commute" to vote and said that they tended to be established migrants who were less likely to return home. Many of the poorer refugees in camps such as Nasir Bagh say they are in no hurry to return to Afghanistan either, whether they vote for its new leader in October or not.

"I will be happy if true democracy and a true Islamic government comes to Afghanistan, but I am very concerned about the present situation," said Sher Hassan, 36, a trader who commutes between Peshawar and his native Afghan city, Jalalabad. "There are still armed militias and police who abuse Pashtuns like me and call us Taliban. If this is the state of affairs, what kind of democracy will the new government be?"

But other longtime Afghan residents, including those hired to spread the word among fellow refugees, said they were determined to make the election a success to help bring political and economic progress to Afghanistan. Abdullah, 28, a teacher who was raised in a camp near Peshawar, said that he had no fear of intimidation from forces opposed to the election -- and that he had already begun his personal campaign at home.

"I said to my mother that we should both vote. She said she didn't want to at first. She is illiterate, and she didn't know what an election was," Abdullah said. "But I talked with her, I told her we have no law and no president in our country and that we need them. After I finished, she said, 'All right, now I am ready to vote.' "

Boys play in an alley in an Afghan refugee camp in Peshawar, Pakistan. Pakistan is home to about 1.5 million refugees.Teacher Meena Musafirazada is helping register refugees to vote. Zazi, 70, plans to vote, though he has lived in Pakistan for 25 years.