US President Barack Obama confounded political logic by triumphing over a sluggish economy to win a second term in office.
A gruelling and often unpleasant campaign yielded, in the end, a decisive victory, built on the strong foundations laid down months ago by his crack campaign team.
Here are some of the keys to Obama's win over Republican Mitt Romney.
The economy was just good enough
The economy, despite tepid growth rates and high unemployment, was not bad enough to doom Obama, and he appears to have finally received belated credit for halting the slide into a second Great Depression.
When he took office in January 2009, the economy was losing 700,000 jobs a month, and while Americans are still dissatisfied with the economy, exit polls suggest they still blame ex-president George W. Bush as much as Obama.
Obama endured months of grisly monthly unemployment numbers, which told a tale of an economy struggling to gain steam.
He got a break over the last few months, as the unemployment rate dipped below the psychological barrier of eight per cent.
Consumer confidence and optimism began to rise along with the stock market, and Americans began to feel a bit more optimistic as house prices finally began a slow rise, despite a lingering foreclosure crisis.
Often criticized as aloof and professorial, Obama, in the final days of his campaign, his voice hoarse, finally seemed to strike a chord with blue collar workers who enrich the Democratic coalition in the rustbelt.
In a twist of political history, Obama was helped by the embrace of his former Democratic antagonist, ex-president Bill Clinton, who buried the hatchet after Obama's defeat of his wife Hillary in the 2008 Democratic primary.
Clinton, remembered for leading an era of economic prosperity, often made the case for Obama better than the president himself.
The two Democratic giants will now stand together in history as the only two Democrats to win a second term since World War II.
You're so Bain
The Obama campaign made a gamble soon after Romney captured the Republican primary - to go negative.
Searing Obama ads and rhetoric branded the former investment manager a corporate vulture, who bought and sold firms for his own profit and heartlessly put good Americans out of work or shipped their jobs overseas.
The plan was to define Romney in a harsh light before he had the chance to introduce himself to Americans with a multi-million dollar blitz of television advertising in the swing states, like Ohio, which would decide the election.
Romney's limp defence of his record as head of Bain Capital, and his missteps - including a refusal to divulge his complicated offshore tax arrangements and a video in which he was seen decrying 47 per cent of Americans as freeloaders who paid no income taxes - played into the stereotype.
By the time of Romney's stellar performance in the first presidential debate in October, the damage had been done.
The Bin Laden bounce
The killing of Al-Qaeda chief Osama bin Laden in a daring Navy SEAL raid in 2011 did not win Obama re-election.
But it bolstered the image of the president as a steely commander-in-chief who kept Americans safe and defused the classic Republican attack that Democrats are weak and cannot be trusted on national security.
Kudos Obama won with the bin Laden raid, not to mention a ruthless drone war against terror suspects abroad, may have also insulated the president against a late-election furore over the killing of the US ambassador to Libya in Benghazi.
The Obama Machine
For the second election running, Obama's campaign team has reinvented the way presidential elections are won.
In 2008, Obama's political braintrust, led by the intense David Plouffe, outwitted the political machine of Bill and Hillary Clinton with a delegate collection strategy that redefined the way primary campaigns are won.
This time around, they defied the strong headwinds of a slowly growing economy and re-elected their president in the face of ferocious Republican opposition.
The path to victory lay in the most sophisticated voter targeting and turnout machine in history, which reached all the way down to neighbourhoods and was constructed over several years.
Way back in October 2011, Obama's political high command insisted to sceptical journalists that the president, smarting from a drubbing in mid-term congressional elections, could and would win re-election.
The strategy: position Obama as a populist warrior for the middle class, and brand his opponent as a rich plutocrat oblivious to the suffering of regular Americans.
Obama's team insisted all along that his coalition of young voters, Hispanics and African Americans, as well as the educated white middle class, would show up for him in 2012, just as they did in 2008.
Republicans scoffed, but they were proven wrong.
According to exit polls, 93 per cent of African Americans backed Obama, along with 69 per cent of Latinos and 70 per cent of Jewish voters, and he was able to limit his losses among white voters.
Obama also won an important victory among unmarried women voters, 68 per cent of whom backed him.