Barack Obama tonight was on course for victory over John McCain in the US election to become the first African-American president, after a momentous day that saw voters turn out in huge numbers.

As key states, including New York, fell his way, Obama was on the verge of a transformational election comparable to Roosevelt's in 1932, Kennedy's in 1960 and Bill Clinton's in 1992.

With polls closing quickly, the Associated Press called 17 states and the District of Columbia for Obama, and 12 for McCain, who trailed his rival by 205 electoral college votes to 80.

"At this point we need a miracle," a McCain aide was quoted as saying on the CBS News website.

An early blow to McCain's hopes came when US television networks projected that Obama would win Pennsylvania. The Republican candidate had based his campaign strategy on stealing the state from the Democrats.

In another big setback for McCain, the Fox News network projected that Obama would win Ohio, the state that ultimately decided the 2004 race between George Bush and John Kerry.

No Republican has won the White House without Ohio. With Ohio and Pennsylvania in his pocket, Obama would be well on his way towards an overall majority.

Piling on the humiliation for the Republicans, Obama was projected to win Virginia by Fox News, the first time the state has voted for a Democrat in a presidential race since 1964, when Lyndon Johnson took the state.

Obama was projected to hold on to all the states the Democrats took in 2004, and win half a dozen or more of the battleground states that had been held by the Republicans.

The Democrat was also projected to win New Hampshire, Connecticut, Delaware, Washington DC, Illinois, Maine, Maryland, Massachusetts and New Jersey.

McCain was projected to win Oklahoma, Tennessee, Kentucky, Georgia and South Carolina.

Despite the encouraging early results, the Obama campaign team urged caution, fearful that a late surge of voters casting their ballots on their way home might yet cause upsets in key states, as happened to the Democratic candidate, John Kerry, in 2004.

Fears that many white voters would fail, in the privacy of the polling booth, to vote for a black candidate appeared to be unfounded, suggesting that race is becoming less of an issue in the US.

Americans voted in record numbers throughout the day as they finally got the chance to turn their backs on eight years of George Bush and choose a new president after America's longest and costliest election campaign.

From the eastern shores of Virginia, across the industrial heartland of Ohio, and on to the Rocky mountain states of Colorado and New Mexico and beyond, poll workers and voters reported long lines and waits of several hours in the most eagerly anticipated US election for half a century.

Turnout was at levels not seen since women were first given the vote in 1920. Election officials predicted turnout would come close to 90% in Virginia and Colorado, and 80% in Ohio and Missouri.

Exit polls gave Obama double-digit leads in states that had been bitterly contested, and on which the outcome depended. The odds had been stacked against McCain from the start, linked, as he was, to President George Bush, with his near-record low popularity ratings, hostility towards the Iraq war and an impending recession.

But McCain managed to hold his own until mid-September, when the Wall Street crash saw Obama open up a commanding lead.

The next president will inherit horrendous economic problems that will limit the scope of his ambitions. Obama, in his final rallies, was already tempering his early promise of change with warnings about how he would have to curb some of his more ambitious plans, trying to lower expectations that he would be able to move quickly on health care and education reform.

The stock market experienced its biggest election day rally in 24 years on expectation of an Obama victory as the Dow Jones industrial averages surged 300 points, or 3%, to close at 9,625.28 points.

Exit polls nationwide provided an early suggestion that it was going to be Obama's night showing that the top concern of 62% of voters was the economy, the issue on which voters said they trusted him more than McCain and blame much of the financial crisis on the Bush administration.

Other early exit poll figures also appeared to be good indicators for Obama, with 57% saying they felt Obama was more in touch with them than the 40% who said the same about McCain.

Reflecting the intensity of the campaign, Obama and McCain put in a final burst of campaigning after casting their own votes. Obama made a final dash from his home in Chicago to neighbouring Indiana, which was Republican in 2004.

Reporters travelling with him reported that the candidate was in a subdued rather than celebratory mood, perhaps reflecting the news of the death of his grandmother on Monday. Obama told them that whatever happened, the campaign, the costliest in US history at over $1bn (£629m) as well as the longest, had been "extraordinary".

Early expectations were of record turnout levels, with the morning bringing long lines at polling stations. However, exit polls later in the day saw voters under 30, the target demographic of the Obama camp, voting at about the same levels as in 2004.

That would be a disappointment for the Obama camp which had been hoping that young voters would buck the tradition of showing enthusiasm for a candidate and then failing to turn out on the day.

Exit polls did chart a rise in African-American turn-out.

CNN, based on the exit polls, projected that Obama would win Vermont, no great surprise as it is traditionally Democrat

Independent election monitors reported sporadic instances of delayed openings of polling stations, broken voting machines, ballot shortages, voter confusion and occasional abuse in a number of battleground states including Florida, Ohio, Colorado, Pennsylvania and Virginia.

The McCain camp raised separate its own charges of irregularities accusing Black Panther activists holding night sticks of standing outside Philadelphia polling stations in an attempt to intimidate white voters.

McCain also accused out-of-state Obama volunteers of casting votes in Florida, and of voters casting multiple ballots in Florida.

In the battle for Congress, the Democrats picked up four seats to increase their majority in the Senate to 55 out of 100 seats. Democrats were hoping to win a Senate majority of 60, the magic number to override blocking tactics by Republicans. In the House, the Democrats were looking to tighten their majority to 261-174, from 235-199.