The president faces a partisan divide in Congress, with Republicans retaining their House majority while Democrats kept control of the Senate, and a looming fiscal crisis of automatic spending cuts and tax increases set to begin next year unless a compromise is reached.
"This is a time for great challenges for America, and I pray that the president will be successful in guiding our nation," Romney said in a concession speech in Boston, where he had watched returns with family and friends. He called Obama to concede and offer congratulations shortly before his remarks.
"At a time like this, we can't risk partisan bickering," Romney, 65, said in a speech that lasted less than five minutes. "We have given our all to this campaign."
Obama, 51, said he looks forward to sitting down with Romney to discuss ways they can work together to move the country forward.
"We may have battled fiercely, but it's only because we love this country deeply, and we care so strongly about its future," Obama said in his victory speech to a crowd that roared its approval.
Obama won the battleground states of Ohio, Virginia, Iowa, New Hampshire, Wisconsin, Nevada and Colorado. He also carried Pennsylvania, where Romney made an 11th-hour bid for support to try to derail the president's drive for re-election. North Carolina was the only battleground Romney won.
Votes were still being tallied in Florida, with Obama in the lead for its 29 electoral votes as the state remained too close to call.
Beginning more than a year ago, Obama and his advisers cast the president as a champion of middle-class opportunity pitted against an opposition party more determined to protect preferences for the wealthy.
"I want you to know that this wasn't fate, and it wasn't an accident. You made this happen," Obama said in an e-mail to supporters after television network projections late last night put him past the 270 threshold. "I will spend the rest of my presidency honoring your support."
Obama said the victory is the "clearest proof yet that, against the odds, ordinary Americans can overcome powerful interests."
States the president won included Michigan, where Romney's father served as governor and where the president benefited from his support of the government's bailout of the auto industry. Obama also easily carried Massachusetts, Romney's home state where he served a term as governor.
With Obama's win in Wisconsin, the home state of Romney running mate Paul Ryan, it was the first time since 1972 that both members of a presidential ticket lost in their home states.
Throughout a volatile Republican nominating contest, Obama's political team never wavered from the view that its eventual opponent would be Romney, a former private equity executive whom they would portray as an out-of-touch embodiment of moneyed privilege and heartless capitalism.
Even before the Republican primary contest ended, as the public was still forming impressions of Romney, Obama and his allies began a campaign to define their opponent.
By summer, they inundated battleground states with commercials featuring layoffs at companies purchased by Romney's former firm, Bain Capital LLC, as well as his Swiss banks accounts and tax returns showing how he took advantage of breaks not available to most middle-income taxpayers.
Romney didn't counter with his own aggressive effort to establish an identity with voters as he focused his campaign on turning the election into a referendum on persistent high joblessness. The unemployment rate under Obama exceeded 8 percent for 43 months, the longest period of such high joblessness since the start of monthly records in 1948.
The negative tone of the campaign on both sides was reflected in their advertising. Between April, when Romney clinched his primary victory, and Oct. 28, nearly nine in 10 of all campaign ads 87 percent were negative, according to New York based Kantar Media's CMAG.
Obama started the campaign with an advantage on the electoral map. The ethnic composition of eligible voters shifted in his favor in many critical states since his 2008 election.
The portion of adult citizens who are members of racial or ethnic minority groups grew by four percentage points in Nevada, three points in Virginia, two in Florida and by one point in Ohio and Iowa between 2008 and 2011, according to an analysis of Census data by William Frey, a demographer at the Brookings Institution in Washington.
Obama's team took advantage by organizing to motivate supporters in the remaining states considered electoral battlegrounds. In some cases, Obama's campaign never disbanded its 2008 efforts and early in the 2012 contest it built more field offices and hired professional staff.
By Election Day, the Obama team claimed to have registered 1.8 million new voters in the battleground states, almost double the number of new voters the campaign registered four years earlier. By last weekend, 28 percent of those new voters had cast ballots through early voting, the campaign said.
"Don't wait" to vote, Obama urged a mostly black crowd of 13,500 voters packed into Cincinnati's Fifth Third Arena on Nov. 4. "Who do you trust?" the president asked the crowd, which shouted back "You!" Saying he knows what "real change" is, Obama added: "I delivered it; I've got the scars to prove it."
The geography of the economic recovery also favored the president in the eight swing states that received the most attention from the two campaigns: Colorado, Florida, Iowa, Ohio, Nevada, New Hampshire, Virginia and Wisconsin.
In five of those states, joblessness was lower than the national average by September, the most recent month for which state-level unemployment data is available.
In Ohio, a state won by every Republican who has ever won the White House, unemployment dropped to 7 percent by September. The Obama campaign promoted the comeback of the auto industry, which was boosted by a government bailout the president backed. One in eight Ohio jobs is directly or indirectly tied to the auto industry, according to a 2010 report by the Center for Automotive Research in Ann Arbor, Michigan.
While Romney took a trip to Europe in July designed in part to heighten his profile on the foreign stage, $1.2 million worth of ads attacking him played 1,947 times on Ohio TV stations.
The Obama campaign hammered relentlessly at Romney's opposition to the federal bailout, memorialized in a November 2008 New York Times opinion article the Republican candidate authored entitled "Let Detroit Go Bankrupt."
A tough stance on illegal immigration that Romney took in the Republican primaries also contributed to lopsided support for Obama among Latino voters.
As the national economy improved during the election year, it weakened the central theme of Romney's campaign. A slowdown in job growth in the last spring and early summer kept Romney close; hiring accelerated again as the election approached.
The 7.9 percent October unemployment rate was a full percentage point lower than a year earlier, the biggest 12-month improvement in joblessness over the period during any election year since 1948 except President Ronald Reagan's 1984 re- election, when unemployment dropped 1.4 percentage points.
The Conference Board's Consumer Confidence Index surged from 61.3 in August to 72.2 in October, showing consumers in the most optimistic mood since February 2008. Through Nov. 5, the benchmark Standard & Poor's 500 stock index was up more than 12 percent for the year and more than 66 percent since Obama took office in January, 2009.