By Maria Golovnina and John Chalmers

KABUL (Reuters) - Even if the Taliban fail to hobble the Afghan presidential election on Saturday, it could take months for a winner to be declared at a time when the country desperately needs a leader to stem rising violence as foreign troops prepare to leave.

Most people expect the election will be better run than the chaotic 2009 vote that handed President Hamid Karzai a second term amid massive fraud and ballot stuffing.

And, despite a crescendo of attacks by the Islamist militant Taliban group in recent weeks, millions of Afghans are eager for a say in their country's future.

The chief risk is that it might take many months - perhaps until October - for Karzai's replacement to be confirmed, especially if a run-off round has to be held.

Any delay would leave little time to complete a pact between Kabul and Washington to keep up to 10,000 U.S. troops in the country beyond 2014, after the bulk of the American force, which currently stands at around 23,500, has pulled out.

Karzai has rejected the agreement, but the three frontrunners to succeed him have pledged to sign it.

Without the pact, far weaker Afghan forces would be left on their own to fight the Taliban, who have mounted an increasingly bold and violent campaign against the Kabul government.

Uncertainty over the outcome could also stall crucial foreign aid and economic reform, foment ethnic tensions and leave a political vacuum in which the Taliban could gain ground.

"The government would not be able to mobilize effectively to counter the insurgency," Franz-Michael Mellbin, the EU's special representative in Afghanistan, told Reuters.

In a country where the political class has long struck deals behind closed doors, however, there could be a trade off between leading candidates to avert a protracted second round.

"We do not dismiss other scenarios, but it's most likely that there is a one-round election and there will not be a long period of uncertainty," Abdullah Abdullah, one of the three leading candidates, told reporters on Wednesday.

Story continues

TURNING POINT

The election will mark the first democratic transfer of power from one president to another since Afghanistan was tipped into chaos by the fall of the Taliban regime following the September 11, 2001, attacks on the United States.

It is a turning point after 13 years of struggle to quell an insurgency that has claimed the lives of nearly 3,500 members of a U.S.-led coalition of troops and many thousands more from Afghanistan's fledging security forces.

Civilians have increasingly been caught up in the violence, and militants bent on returning Afghanistan to the strict Islamic rule under the Taliban have warned they would be targeted if they tried to vote at the weekend.

Billions of dollars in aid have been poured in, bringing gains in infrastructure, education and health to one of the world's most destitute nations. The United States alone has spent more than $90 billion on aid and training Afghan forces.

Now, despite the fragility of that progress, many are optimistic that a brighter future may be at hand.

"I am very happy and very excited," said Abdul Wali, headmaster at a high school in the southern city of Kandahar that will be used as a polling station on Saturday.

"The big concern we have is fraud in elections and we, all the people, are trying our best to prevent it."

It is unlikely the process will be smooth.

"Afghanistan's electoral system is so badly hampered by fraud, insecurity, and institutional weakness that there is no effective way of knowing what the 'true' vote is," the Afghanistan Analysts Network said in a research note this week.

It said that estimates of the number of voters range from 10 to 12 million, but some 21 million voter cards have been issued.

The Independent Election Commission says it will take six weeks for the result of Saturday's vote to be announced, as 3,000 donkeys will have to carry ballot papers back to Kabul from the country's most inaccessible areas.

Candidates might then contest the outcome, claiming that millions were unable to cast their votes because of Taliban threats, or that there was a repeat of the large-scale ballot stuffing that marred the 2009 election.

At least 10 percent of polling stations are expected to be shut due to security threats. Further undermining the election, most foreign observers have pulled out of Afghanistan in the wake of a deadly attack on a hotel in Kabul last month.

If no one candidate wins over 50 percent, the two with the most votes go into a run-off on May 28, spinning out the process into the holy month of Ramadan when life slows to a crawl.

There have been no reliable opinion polls, but it is widely agreed that, of eight candidates, Ashraf Ghani Ahmadzai, Zalmay Rassoul and Abdullah have the best chance of winning.

Unlike 2009, when Karzai could count on the lion's share of votes from the ethnic Pashtun majority, they will now be split between American-trained anthropologist Ghani and former foreign minister Rassoul, both Pashtuns.

Abdullah, a former opthalmologist-turned-fighter of Soviet forces in the 1980s who dropped out of a run-off with Karzai in 2009 citing mass fraud, enjoys strong support from the Tajik community in the north.

Karzai, plucked from obscurity to lead post-Taliban Afghanistan, is believed to want to retain a hand in politics. He has not publicly backed any of the candidates, but Rassoul is widely perceived to be his man as the two are close friends.

Although Karzai's departure is a turning point for Afghanistan, none of his would-be successors would bring radical change, Western diplomats say. All three favorites come from the same crop of politicians who built their careers in the early years of Karzai's rule and share similar views.

In a country exhausted after decades of war and closed-door deal making, many voters are disillusioned about the ballot.

"This is a political game played by the politicians but the ordinary people always pay the price," said Mohammad Shafi, a restaurant owner in the eastern city of Jalalabad.

"If one attack happens, thousands will avoid coming out to risk their lives and vote."

(Additional reporting by Hamid Shalizi in JALALABAD and Jessica Donati in KANDAHAR, Afghanistan; Editing by Mike Collett-White)