While there were reports of disrupted voting in troubled places like Logar Province and neighboring Wardak, in Helmand Province in the south and Nangarhar Province in the east, at the same time voters were showing up in unexpectedly high numbers in other places, like Zabul, Uruzgan and Kandahar Provinces in the south, and Kunar Province in the northeast, despite strong insurgent presences in those areas.

In Uruzgan, election authorities had to open additional polling places to accommodate unexpected numbers, while in Daikundi they ran out of ballots in some remote districts and election authorities had to race new ones out to them. In northern Mazar-i-Sharif, voters were still lined up after dark.

Underwritten by $100 million from the United Nations and foreign donors, the election was a huge enterprise, stretching across extremely forbidding terrain. Some 3,200 donkeys were pressed into service to deliver ballots to remote mountain villages, along with battalions of trucks and minibuses to 6,500 polling places in all. The American military pitched in with air transport of ballots to four regional distribution centers, and to two difficult-to-reach provinces.

Though many international observers left Afghanistan in the wake of attacks on foreigners, or found themselves confined to quarters in Kabul, years of expensive preparations and training of an army of some 70,000 Afghan election observers were expected to compensate, according to Western diplomats and Afghan election officials. “We have so many controls now, it’s going to be much safer this time,” said Noor Ahmad Noor, the spokesman for the Independent Election Commission.

The American ambassador, James B. Cunningham, called the elections a “really historic opportunity for the people of Afghanistan to move forward with something we’ve been trying to create together with them for several years now.”

Still up in the air is the question of whether an American troop force will remain in Afghanistan after 2014. Mr. Karzai’s refusal to sign a long-term security deal to allow that presence was a major point of tension between the American and Afghan governments. Each of the leading candidates has agreed to sign the deal once in office, though inauguration day may not take place until well into the year.

The election on Saturday was notable also for how many Afghan women were taking part. More female candidates than ever before are on provincial ballots, and two are running for vice president, the first time a woman was ever put up for national office here, which has generated a great deal of enthusiasm, especially in urban areas.