After being ruled by the gun for the past two decades and by kings for the previous two centuries, Afghans are less than three months away from voting in their country's first democratic election.

But is the country ready?

Some political analysts -- and a few candidates -- contend that despite Afghanistan's long wait for democracy, the presidential election scheduled for Oct. 9 has been hastily arranged by foreign governments more concerned with their own priorities than with those of Afghans.

In many parts of this mountainous, landlocked country the size of Texas, armed factional leaders exercise greater power than the central government, commanding private militias and collecting taxes and other revenue. Remnants of the ousted Taliban Islamic movement and the al Qaeda network continue to wage a running insurgency, battling 20,000 American and allied troops and vowing to disrupt the election.

In addition, no one is certain how many Afghans are eligible to vote, because there has been no census in decades. There are no clear guidelines for how candidates will finance their campaigns or who will guarantee their security if they travel around the country. There is no plan in place for international monitoring of the vote or for safeguarding ballots as they are moved from isolated villages to provincial capitals.

"It's paradoxical that the international community, especially the United States, has invested a lot in the electoral process but has not put in the resources to guarantee it's free and fair," said Vikram Parekh, senior analyst with the International Crisis Group, a Brussels-based research organization. "The big question is: Is the country prepared for a democratic exercise?"

After U.S. forces and Afghan militias drove the Taliban from power in late 2001, Afghan factional leaders and representatives of foreign powers met that December in Bonn, Germany, to chart a path that would lead Afghanistan to a form of representative government.

In addition to naming Hamid Karzai president and parceling out positions in his cabinet among ethnic and regional factions, participants adopted a timetable that would bring elections by the middle of this year.

But many are questioning whether that goal was too optimistic. Even though the election is a few months behind schedule and will not include a vote for members of parliament, Parekh said he thought the time frame set by Bonn was "unrealistic, given what people had to establish here from the ground up."

Foreign Minister Abdullah, a former faction official from northern Afghanistan who has been the country's top diplomat since the Bonn conference, said he, too, thought the election was being held prematurely. The current government -- an interim administration chosen at a grand council, or loya jirga, in July 2002 -- needs more time to rebuild the country's shattered institutions, he said.

"A preferable situation might have been if we had a five-year term for the government, so we could create institutions and [do] the basic work," Abdullah said.

This past week, 23 candidates filed the paperwork required to run for president. Some said that the rush to elections favored the incumbent, Karzai, and questioned the fairness of the process.

"The situation for elections is not suitable," said a challenger from Karzai's Pashtun ethnic group, Ahmad Shah Ahmadzai. "This is not the right time. They should postpone it until next year."

Like many Afghans, Ahmadzai accused the Bush administration of pushing the Afghan process ahead so the election would take place before the U.S. elections in November.

"We are sacrificing our elections for the November election in America -- otherwise there is no reason to have our election in such a hurry," contended Ahmadzai, 60, a wealthy businessman. "Mr. Bush wants to show, 'I am a hero and had the election in Afghanistan.' They are forcing everything for their own election and not for the poor Afghans."

Other observers argued that there is no perfect time to hold an election in a country recovering from decades of war and that even a messy, flawed election would bring the Afghan government needed legitimacy.

"Is it going to be an election like we're used to in a Western democracy? Probably not. But it's a first step," said Grant Kippen, country director for the congressionally funded National Democratic Institute, which is helping with preparations. "I look at it more as a process rather than an event. We need to send a signal to a whole bunch of groups -- the ordinary citizens, the Taliban and al Qaeda, the government -- that we're serious about Afghanistan and helping them."

One thing observers agree on is that incumbency gives Karzai a formidable advantage over his challengers. He is known around the entire country and dominates the state-run media.

In a recent public opinion poll conducted in Afghanistan by the Asia Foundation, a U.S.-based nongovernmental group, 62 percent of respondents gave Karzai a favorable job-approval rating, and he received an 85 percent personal popularity rating. However, in southern Afghanistan, the Pashtun heartland where Karzai has his roots, his approval rating was only 35 percent, while 46 percent said he was doing a fair or poor job.

While he is widely credited with restoring stability to many parts of the country, Karzai is faulted for not having improved economic conditions for ordinary Afghans despite a massive influx of foreign aid.

"I prefer Karzai," said Shah Mohammad, 29, a fruit vendor in a northern Kabul neighborhood populated largely by ethnic Tajiks. "He hasn't created any jobs, but he's secured the country."

Another man, Shuja Mohammad, also 29, said he would vote for Yonus Qanooni, an ethnic Tajik former cabinet member who may be Karzai's strongest challenger. As for Karzai, he said, "If he was able to do something, he would have done it in the last two years."

That is precisely the kind of sentiment that Karzai's rivals hope to tap.

"The situation is degrading. The gap between the people and the government is growing larger every day," said Homayun Shah Asefi, a French-trained lawyer and former diplomat whose connections to Afghanistan's former king could enable him to challenge Karzai among Pashtun voters.

Ahmadzai, the other main Pashtun candidate, said: "Corruption is very high. If you collect all the corruption in the world, it wouldn't come close to Afghanistan."

He added, "When I list the defects of the government, every Afghan knows this -- that is why I am optimistic I can win."

Whether such calculations mean anything to the many poor Afghans with little formal education is hard to gauge. Many scarcely know what an election is, never having experienced one.

"We heard they will put a lot of boxes beside each other and tell us to put a card in the box for whoever we like," said Mohamed Shafi, a 57-year-old from Mazar-e Sharif who was selling melons from a kiosk in Kabul.

Asked about democracy, he replied: "Democracy means freedom, and do whatever you want."