In a low-slung building tucked behind concrete blast barriers on the edge of the Afghan capital, the plain brown envelopes are opened one by one, and the complaint forms inside smoothed out and scrutinized by weary-eyed workers.

One handwritten account tells of a gunman turning up at a polling place. Another describes a candidate brazenly handing out cash bribes. Yet another reports a ballot box filled with votes only moments after the start of polling.

Nearly two weeks after Afghanistan's troubled presidential election, the task of sorting out allegations of fraud and intimidation has swelled. More than 2,000 complaints have poured into the Electoral Complaints Commission, a U.N.-backed body given the responsibility of determining the validity of claims of election misconduct. As the vote tally slowly advances, that task becomes more and more crucial.

With nearly half the vote counted, President Hamid Karzai was polling around 46%. That falls short of the absolute majority he would need to avoid a runoff with his principal rival, former Foreign Minister Abdullah Abdullah, but has him within striking distance of his goal.

If the total count puts Karzai over the top, many fear an explosion of violence by followers of Abdullah, who has repeatedly stated that the only way Karzai could win the election outright would be by having committed massive fraud.

Ironically, the whole point of the election -- only the country's second-ever direct presidential vote -- was to boost the legitimacy of the Afghan government, whoever wound up heading it. Instead, it appears that the next leader may assume office under a cloud of popular suspicion.

All the major candidates in a field of more than two dozen have lodged complaints against others, though the Karzai-Abdullah race has been the most bitterly contested. Some employ dramatic methods: One presidential hopeful, Mirwais Yassini, came personally to the complaints office and dumped bags of what he said were doctored ballots.

"Whichever one they say has won -- how can I believe it?" said Ishtiaq Mohammed, a bicycle mechanic in Kabul, the capital. "Maybe we will have to do this thing all over again. And it was so hard the first time."

A turnout figure has not yet been disclosed. Millions of Afghans braved Taliban threats and attacks to come to the polls. However, violence or the fear of it kept many people at home, particularly in Afghanistan's south, where fighting is fiercest between insurgents and Western troops.

The vote-counting process has been not only contentious, but agonizingly slow. Some districts are so remote that ballots had to be delivered to polling places by donkey convoys and helicopters; that process had to be reversed once the votes were cast.

An additional complication is that Ramadan, when observant Muslims fast from dawn to dusk, began just after election day. As in much of the Islamic world, the holy month is not especially conducive to a brisk pace of work. During Ramadan, the workday is shorter, and those who are fasting fight sleepiness and hunger while on the job.

On a recent day in the Electoral Complaints Commission processing center, where work ends by 3 p.m., some Afghans manning "triage" tables, where complaints deemed the most urgent are sorted, stifled yawns and rubbed their eyes as the hot afternoon wore on.

The commission had initially hoped to adjudicate all complaints by Sept. 17, with a runoff -- if there is one -- to be held two weeks after the vote tally was certified. But officials caution that this is only a target date, not a legal deadline, and have pledged that as much time as necessary will be devoted to the task.

At least 700 of the complaints received by the commission are classified as Category A, serious enough in scope and nature to have the potential to alter the election's outcome. Investigators have fanned out to the provinces to review claims viewed as credible, though their efforts are hampered by security concerns.

One investigator, speaking on condition of anonymity because she was not authorized to talk about her work and out of concern for her own safety, said Taliban members in one disputed southern district had warned that anyone caught there on election business would be fair game for abduction and possible execution.

"I'm happy I voted, but I'm not sure now that it did any good," said Seema Humayoun, a Kabul resident who voted at her neighborhood mosque though some family members urged her to stay home because there had been a suicide bombing nearby a few days earlier.

"It will be very, very sad," she said, "if it all was for nothing."

laura.king@latimes.com