Oh, what a night. In years to come we'll ask each other: "Where were you when Barack Obama was elected?" because, whichever side of the fence you're on, you must feel that this result will mean one thing, and not just for the US: change.

Oh, what a night. In years to come we'll ask each other: "Where were you when Barack Obama was elected?" because, whichever side of the fence you're on, you must feel that this result will mean one thing, and not just for the US: change.

I was driving home from a 17-hour stint at The Herald wordface when the California result swept the Illinois senator over the magic threshold like a huge wave crashing over a sandbar and on to the coast at Big Sur.

Through the darkness I could hear Martin Luther King's pledge that one day people "will be judged not by the colour of their skin but by the content of their character".

Like many of those schooled in the Bradley effect, and prone to political neurosis, I feared John McCain would somehow steal this election. As left-leaning blogger Michael Tomasky put it: "Liberal election anxiety is grounded in the hard experiences of 2000 and 2004." Remember the Daily Mirror's splendidly non-PC headline on November 4, 2004: "How could 59,054,087 people be so dumb?"

It still feels like a dream, an American dream, of course. After writing about this campaign for 21 months, I'll need to check this copy for conditionals and subjunctives because in 75 days Barack Obama will take the oath of allegiance and become America's first black President.

African-Americans didn't even have the vote when he was born 47 years ago, and in 16 American states the marriage between his white American mom and black Kenyan dad would have been illegal. When I lived in the US in the 1970s, black presidential candidates were about protest votes. So the sight of the Obama and Biden families mingling and hugging, as an emotional multiracial crowd cheered and flag-waved and cried for joy, felt like the last scene of a Hollywood weepy.

Of course, this race was not primarily about race. Black voters make up, at most, 13% of the electorate. To win, he needed not only huge personal charm but also a critique and a programme that brought in blue-collar workers worried about their jobs, middle-class families struggling with mortgage payments, women who had vehemently supported Hillary Clinton, Hispanics the list goes on.

In the midst of the Jeremiah Wright affair, when his campaign was in real peril, he crystallised his vision of a future transcending racial divisions and stereotypes in a historic speech of dazzling brilliance. Yet, as he said that day, he's not so naive as to believe the US can leave behind its "racial stalemate" of mutual suspicion and recrimination in one presidential term.

In his acceptance speech, Obama claimed: "We have never been just a collection of red states and blue states." Yet just how far the US has to go is obvious looking at the map of yesterday's results. The distribution of electoral college votes state by state is disturbingly like looking at a map of the American Civil War. Basically, the Republican Party ended up being pinned back into the old Confederacy - the states that fought to keep and extend black slavery.

Of the 11 southern states that made up the Confederacy, all voted for McCain except North Carolina, which was too close to call yesterday, plus Virginia and Florida, two states that have experienced huge inflows of population from other parts of the US. Yet all have big African-American populations that voted more than 90% for Obama.

Conversely, of the 25 states that fought against slavery on the Unionist side, 21 have gone to Obama. Of the other four, Missouri was still undecided yesterday and West Virginia, Kansas and Kentucky fell to McCain. During the Civil War, all four were flip-flop states, with strong pro-secessionist factions and all, except Kansas, had slave-holding estates.

Paradoxically, of course, Obama's personal history is not part of the history of slavery or the civil rights movement, as his father was a Kenyan who came to Hawaii as a student and later returned home. However, the US can no more disown slavery than the Stars and Stripes, or the Pilgrim Fathers. It's in its DNA.

A new edition of The Federalist Papers, edited by Lawrence Goldman of Oxford University, offers a sobering reminder of how it all started. Published anonymously in 1787, they were intended to persuade the citizens of New York of the case for ratifying the United States Constitution. They offer a fascinating glimpse into the mindset of the founding fathers. The tension between big and small government lies at the heart of the argument, an issue Joe the Plumber and the McCain camp revisited during this campaign, in the wake of a stunning example of big government, in the shape of the $700bn bank bail-out. But it is James Madison's painful contortions on the subject of slavery and the slave trade that are the most telling.

Madison, who would become the fourth US President, knew Thomas Jefferson well. Both were rich Virginian slave-holders. Yet Madison apparently feels so compromised by the need to refer to slaves in a document full of eloquent language about the rights of man, that he puts his argument in the mouth of a fictitious southerner ("one of our southern brethren"), who proceeds to justify counting each slave as three-fifths of a person.

This represents the infamous compromise between a slave as a human being and a farm animal that finds its way into Article 1 of the American Constitution.

Obama's election doesn't transcend race. It can't. It's just the latest chapter, albeit a startling one, in a long-running saga. As Harry Reid observes above, his challenge now is to live up to the hyperbole he has created.

The Obama story appeals to us because it embodies what we like most about the US. This Hawaiian beach log-cabin to White House narrative, with its struggling single mother and selfless white granny, really does embody the American dream of endless possibility. Now 11 million black American children can aspire to become President. But, as Obama knows full well, the true story of America is a country where a black high-school dropout is 60 times more likely to end up in prison than a graduate and where 40% of the country's gargantuan 2,300,000 prison population is black. Millions voted for Obama not because they share his dream but because they don't.

Today, however, we should celebrate just how far the US has come since 1787, or even since 1967 when another super-cool black man, Sidney Poitier, caused a huge sensation in the landmark movie Guess Who's Coming to Dinner?.

A young white student falls in love with a black man and takes him home, generating all manner of amusing awkwardness. Today this movie looks ridiculous but it contains some prescient lines. In one scene, the girl boasts that their mixed-race children will grow up to be "President of the United States and they'll all have colourful administrations".

Well, guess who's coming to dinner at the White House, every night from January 20, 2009?