In the end, President Barack Obama won re-election on the issue that was supposed to send him packing: the sluggish US economy. The United States is still digging out from the deepest recession in 80 years, and employers are barely adding enough jobs to keep pace with population growth.
Trillions of dollars of household wealth have vanished in the housing bubble, while the gap between rich and poor widens. But historically, voters have given a second term to incumbent presidents who preside over even modest economic growth during an election year. That pattern appears to have held for Obama.
If the economy is not exactly roaring ahead, it improved steadily over the course of the year. "It was never going to be a landslide," said John Sides, a political science professor at George Washington University. "But it was always his race to lose."
The Democratic president took major steps to boost the economy, but they did not seem to help him much in the eyes of voters. Polls show deep divisions on the merits of his 2009 stimulus, his Dodd-Frank financial reforms and the auto industry bailout. But they made a difference in one important place.
Obama campaigned heavily on the auto bailout in Ohio, where 1 in 8 jobs is tied to the industry. That may have helped him limit his losses there among white men, a slice of the electorate that Romney won heavily elsewhere.
According to Reuters/Ipsos exit polls, Obama lost white men nationwide by 21 percentage points. In Ohio, he lost white men by only 12 points.
Obama was also helped by the fact that voters largely blame the recession on his Republican predecessor, President George W Bush.
Obama made that a central part of his campaign message as he argued that Romney would bring back policies that precipitated the crash. If the Romney campaign wanted to focus the election on Obama's economic stewardship, the Obama campaign wanted to make it a choice between two candidates.
Obama's campaign attacked early with a barrage of negative advertising that painted the multimillionaire former private-equity executive as a corporate raider with little concern about the fortunes of ordinary people. The attacks drew unflattering comparisons to Obama's historic 2008 run for office, but they discredited Romney in the eyes of many voters.
"A lot of middle-class white people who don't have a college degree came to the conclusion that Romney's just not one of us," said Potomac Research Group analyst Greg Valliere.
Obama's narrow re-election victory will not strike fear in the hearts of Republicans, who remain in control of the House of Representatives. Obama's Democrats held on to the Senate, but fewer moderates of either party will be in the mix. That is a recipe for more gridlock and white-knuckle showdowns over taxes and spending. Reaching consensus on even the most routine legislation will be difficult.
"There's not going to be a lot of goodwill on the Hill," said Princeton University history professor Julian Zelizer. "The party lines will be hardened after this election." The increased polarisation may make governing more difficult, but it made campaigning easier for Obama.
In an age of intense partisan sentiment, Obama enjoyed more reliable support from members of his own party than his Democratic predecessors Jimmy Carter and Bill Clinton. "There are just a lot fewer people who are going to shift from one candidate or another. They're just a lot more hardened on either side," said Taylor Griffin, who advised Republican nominee John McCain during the 2008 campaign.
For Republicans, Obama's re-election poses uncomfortable questions. For the second election in a row, the Republican presidential candidate has been unable to win more than 1 in 3 Hispanic voters, and the party could have an increasingly difficult time competing in national elections if it fails to make inroads among that rapidly growing slice of the electorate.
The party's gravity center now rests in the House of Representatives, where many lawmakers represent solidly conservative districts. They face little incentive to compromise on issues like immigration reform that could anger their base of older, white voters.
Romney had to overcome lingering suspicion from conservatives during the drawn-out battle for the Republican nomination, and he was unable to appeal to independent swing voters until the campaign's closing month. But many in the party are likely to conclude that they will be better off nominating a more conservative candidate next time, said Brookings Institution fellow John Hudak.
"The party is going to move right," he said. "The line is going to be, 'See, we shouldn't have nominated a moderate'."