As the sun rose over Soweto on South Africa's first democratic election in 1994, the Mwale family were too busy with practical matters to ponder the historical resonance of the day.

Following rumours that a white supremacist group was going to poison the main water tank, they boiled the water and cooked a huge pot of mealies. The day before, during early voting, granny had waited seven hours to cast her ballot for Nelson Mandela and the kids had to bring her food. Now it would be granny's turn to come to the rescue.

I recall walking with the mother of the house, Esther Mwale, in silence at 7am through zone 9 of Meadowlands, the morning fog slowly lifting to reveal that people had ironed their best trousers and put on their sturdiest shoes for the day. All dressed up for democracy.

The two hours Esther spent queueing to vote somehow served as a dignified, humane response to the horrors of apartheid. After his wife, Ruth First, was killed by the regime, African National Congress militant Joe Slovo said: "The most effective punishment is to force those who did it to live in a democratic South Africa." And here it was.

But if long lines of black people at polling stations showed the promise of a fledgling democracy in South Africa, the prospect of similar scenes next week will illustrate a failing democracy in the US. A longstanding, systematic, legal and political campaign to suppress the vote in Democratic areas combined with the shambolic, shameful neglect of the electoral infrastructure could yet cause chaos on an unprecedented scale.

In short, come next Tuesday, the issue may not so much be who votes for whom, but who gets to vote and whose votes get counted. A recent CNN poll showed that 42% of voters are not confident their vote will be accurately cast and counted - almost three times the figure four years ago. With the record numbers of newly registered voters will be a record number of lawyers on both sides. If it's close, the courts may once again pick the winner.

The popular response to such an unpopular outcome is not difficult to imagine. According to the Washington magazine The Hill, police across the country are preparing for unrest. Swat teams will be on standby in Oakland, California. The Democratic secretary of state in Ohio now has protection from death threats after she refused to make a list of 200,000 newly registered voters available to Republicans.

Some of this mayhem stems from a noxious blend of officiousness and incompetence. In Jackson County, West Virginia, people have been hitting the touch-screen for Barack Obama and finding they have voted for John McCain. In Florida they are testdriving the third ballot system in three election cycles. Election workers are struggling. Those who thought they would vote early and avoid the queues are waiting in line for three hours.

Added to the technological flaws with machines and lack of technical training for those operating them are technocratic electoral laws that aren't fair, don't work and in any case aren't being heeded. According to the New York Times, tens of thousands of eligible voters in six battleground states have been illegally removed from voter rolls or will be prevented from voting in ways that violate federal law. In Wisconsin, one in five voters' names on the registration database did not completely match names on other state records, including four of the six former judges charged with overseeing the elections. Both presidential candidates may have been wasting their time wooing Samuel Joseph Wurzelbacher - aka Joe the plumber - at the last debate. He is registered as Worzelbacher, and therefore may find himself ineligible to vote.

While this is happening everywhere (Jackson county is 98% white and voted for Bush in the last two elections), it is compounded by a protracted Republican effort to disenfranchise Democratic voters under the guise of combating voter fraud. Voter fraud is a serious issue. The trouble is it barely exists. In the six years since the Bush administration has made it a priority, barely 100 people have been convicted and fewer than 200 have been charged. The overwhelming majority were either people who thought they were eligible but weren't (immigrants, felons etc) or those registering fictitious people.

"If they found a single case of a conspiracy to affect the outcome of a Congressional election or a statewide election, that would be significant," Richard Hasen, election law expert at the Loyola Law School, told the New York Times last year. "But what we see is isolated, small-scale activities that often have not shown any kind of criminal intent."

But that hasn't stopped Republicans trying. Five of the 12 US attorneys who were fired last year, in the scandal that led to the resignation of US attorney general Alberto Gonzales, were axed because they refused to pursue the issue of voter fraud with sufficient vigour. It also explains the Republican attacks on the community group Acorn, which pays people to register voters in low income and minority areas. Some of Acorn's workers made up names. That should be and has been condemned. But there is no evidence that it has resulted in a single fraudulent vote ever being cast since Acorn began its large-scale voter registration drives four years ago.

While attempts at voter suppression are partisan in intent they are racial in effect. The Democrats have not won an election without the black vote since 1964. The most effective and crude way to undermine their base is to minimise the vote in black areas. This is precisely what happened in Florida in 2000, where Republicans lowered the threshold for inclusion on the "purge list" of ineligible voters. By the time they were done, African-Americans accounted for 88% of those purged, even though they only comprised 11% of the actual electorate.

The practical consequences of this interference, manipulation and, at times, intimidation is twofold. It disenfranchises people who either don't have the time, inclination or wherewithal to stand up to officialdom. And it creates huge lines while others stay and fight. A Democratic party survey from 2004 found half of the state's African-American voters in Ohio reported some problems at the polls on election day. On average, black voters waited in longer lines than whites, were more likely to be asked for identification when they got there and felt more intimidated.

This year will be worse. Obama's strategy has hinged on registering huge numbers of new voters. Overrepresented among them are the black, the young and first-time voters. For at least six months this eventuality has been predictable. And yet electoral officers around the country have declared themselves entirely unprepared. Just as in South Africa 14 years ago, the huge turnout we are seeing in early voting, and which will undoubtedly come on election day, marks a celebration of a historic moment in the nation's democracy. But the long lines and their demographic composition will mark not dignity but disorganisation and discrimination.

It remains one of the paradoxes of this election that black America may yet get a president before black Americans have fully secured their right to vote.

g.younge@theguardian.com

· This article was amended on Monday October 27 2008. It said 12 US judges were fired last year. This has been corrected to 12 US attorneys