AT the end of September the US presidential election seemed all but over.

Barack Obama appeared to have his second term in the bag, with a comfortable seven-point lead over his faltering Republican rival Mitt Romney.

The former governor of Massachusetts had spent the summer going from gaffe to gaffe; the spectacle branded the "Romneyshambles".

Then came the first TV debate.

It unexpectedly showed the normally cool and collected President showing signs of tired indifference while the challenger seemed fired up, as he landed a series of blows on his rival.

The political corpse that was the Republican presidential campaign suddenly sprang into life and, while Mr Obama upped his game in the next two head-to-heads, it was clear the race for the White House was back on.

The Democrat machine, taken by surprise by Mr Romney's more assured performances in front of the camera, began to up its attacks on the self-made millionaire.

While the Romney camp played up their man's strengths as an astute businessman who had made the 2002 Salt Lake City Winter Olympics a success, its opponents suggested the Republican challenger had headed a firm that shamefully outsourced American jobs abroad.

Political pressure also forced Mr Romney to release his tax return for 2011, which showed he had paid a rate of just 14%. In other words, in Democrat-speak, he was out of touch with ordinary Americans.

Yet the Republican attack on Mr Obama's economic record was beginning to focus minds with the question – are you better off now than you were in those hopeful "yes we can" days of 2008?

The challenger insisted he was now the change candidate and would shake up Washington. The polls began to close.

Interestingly, the two candidates divided the nation they were seeking to lead. Pundits pointed out that while Mr Obama could generally rely on the votes of women, blacks, Hispanics and young urban dwellers, Mr Romney could look to men, whites, pensioners and those in rural areas to give him their support.

The Democrat incumbent was dealt a bad hand on the economy, coming to power just as the world recession hit. But employment numbers have been improving, helping Mr Obama's pitch for voters to give him four more years to "finish the job" he started.

He has based his campaign on his £490 billion stimulus plan, increasing taxes on millionaires and widening public healthcare. Mr Romney, whose campaign has been heavily predicated on his opponent's failure to turn the economy round in four years, has promised to cut taxes for everyone, increase defence spending and repeal the President's controversial public healthcare plan.

On foreign policy, the Republican challenger has had difficulty competing with Mr Obama, who saw the end of Osama Bin Laden, America's public enemy number one.

Mr Romney started his campaign as a hawk, even suggesting bombing Iran, but ended up something of a dove, telling his opponent "you can't kill your way" against Islamic extremism.

The one unpredictable has been the weather.

Superstorm Sandy had two effects. Firstly, it helped Mr Obama play up his role as father of the nation; the photograph of him hugging a victim amid the carnage was worth pages of copy. Two-thirds of Americans gave him a positive approval rating.

Secondly, Sandy halted the momentum Mr Romney had been building up. Karl Rove, who masterminded George W Bush's election victories, said: "If you hadn't had the storm, there would have been more of a chance for the Romney campaign to talk about the deficit, the debt, the economy."

The nature of the electoral system means the contest for the White House came down to just nine swing states – Colorado, Nevada, Wisconsin, Iowa, New Hampshire, North Carolina, Virginia, Florida and, most importantly of all, Ohio.

The body language of the past few days showed a growing confidence in the Democrat camp.

Obama strategist David Axelrod boasted: "We have many pathways to victory through the electoral college and they are all still intact."

The fact that yesterday Mr Romney was still squeezing the last few hours before the result campaigning in Pennsylvania and Ohio, suggested he was the more worried of the candidates.

The Republicans mounted a polling day TV advertising blitz in, among other places, Ohio and Pennsylvania, hoping for a Reaganesque last-minute surge. No Republican candidate has ever won the presidency without Ohio.

Turnout was regarded as crucial. The Democrats, with Mr Obama helping work the phones, frantically made sure their supporters got to the polls, with almost 33,000 volunteers working three-hour shifts in the swing state.

For all the billions of dollars spent, for all the negative campaigning and for all the positive assertions by both candidates that they would bring voters together, what the US presidential campaign has once again demonstrated is that the Commander-in-Chief will lead a very Disunited States of America.