WASHINGTON (AP) -- His lease renewed in trying economic times, President Barack Obama claimed a second term from an incredibly divided electorate and immediately braced for daunting challenges and progress that comes only in fits and starts.
"We have fought our way back and we know in our hearts that for the United States of America, the best is yet to come," Obama said.
The same voters who gave Obama another four years also elected a divided Congress, re-upping the dynamic that has made it so hard for the president to advance his agenda. Democrats retained control of the Senate; Republicans renewed their majority in the House.
It was a sweet victory for Obama, but nothing like the jubilant celebration of four years earlier, when his hope-and-change election as the nation's first black president captivated the world. This time, Obama ground out his win with a stay-the-course pitch that essentially boiled down to a plea for more time to make things right and a hope that Congress will be more accommodating than in the past.
The vanquished Republican, Mitt Romney, tried to set a more conciliatory tone on the way off the stage.
"At a time like this, we can't risk partisan bickering," Romney said after a campaign filled with it. "Our leaders have to reach across the aisle to do the people's work."
House Speaker John Boehner spoke of a dual mandate, saying, "If there is a mandate, it is a mandate for both parties to find common ground and take steps together to help our economy grow and create jobs."
Senate Republican Leader Mitch McConnell had a more harsh assessment.
"The voters have not endorsed the failures or excesses of the president's first term," McConnell said. "They have simply given him more time to finish the job they asked him to do together" with a balanced Congress.
Obama claimed a commanding electoral mandate - at least 303 electoral votes to 206 for Romney - and had a near-sweep of the nine most hotly contested battleground states.
But the close breakdown in the popular vote showed Americans' differences over how best to meet the nation's challenges. With more than 90 percent of precincts reporting, the popular vote went 50 percent for Obama to 48.4 percent for Romney, the businessman-turned-politician who had argued that Obama had failed to turn around the economy and said it was time for a new approach keyed to lower taxes and a less intrusive government.
Obama's re-election assured certainty on some fronts: His signature health-care overhaul will endure, as will the Wall Street reforms enacted after the economic meltdown. The drawdown of troops in Afghanistan will continue apace. And with an aging Supreme Court, the president is likely to have at least one more nomination to the high court.
The challenges immediately ahead for the 44th president are all too familiar: an economy still baby-stepping its way toward full health, 23 million Americans still out of work or in search of better jobs, civil war in Syria, an ominous standoff over Iran's nuclear program, and more.
Sharp differences with Republicans in Congress on taxes, spending, deficit reduction, immigration and more await.
And even before Obama gets to his second inaugural on Jan. 20, he must grapple with the threatened "fiscal cliff" - a combination of automatic tax increases and steep across-the-board spending cuts that are set to take effect in January if Washington doesn't quickly come up with a workaround budget deal. Economists have warned the economy could tip back into recession absent a deal.
Despite long lines at polls in many places, turnout overall looked to be down from four years ago as the president pieced together a winning coalition of women, young people, minorities and lower-income voters that reflected the country's changing demographics. Obama's superior ground organization in the battleground states was key to his success.
The president's victory speech - he'd written a concession, too, just in case - reflected the realities of the rough road ahead.
"By itself the recognition that we have common hopes and dreams won't end all the gridlock, or solve all our problems or substitute for the painstaking work of building consensus and making the difficult compromises needed to move this country forward," Obama said.
"But that common bond is where we must begin. Our economy is recovering. A decade of war is ending. A long campaign is now over, and whether I earned your vote or not, I have listened to you, I have learned from you and you have made me a better president."
The president said he hoped to meet with Romney and discuss how they can work together. They may have battled fiercely, he said, "but it's only because we love this country deeply."
Romney's short concession - with misplaced confidence, he'd only prepared an acceptance speech - was a gracious end note after a grueling campaign.
He wished the president's family well and told subdued supporters in Boston, "I so wish that I had been able to fulfill your hopes to lead the country in a different direction, but the nation chose another leader and so Ann and I join with you to earnestly pray for him and for this great nation."
Obama's re-election was a remarkable achievement given that Americans are anything but enthusiastic about the state they're in: Only about 4 in 10 voters thought the economy is getting better, just one quarter thought they're better off financially than four years ago and a little more than half think the country is on the wrong track, exit polls showed.
But even now, four years after George W. Bush left office, voters were more likely to blame Bush than Obama for the fix they're in.
It wasn't just the president and Congress who were on the ballot. Voters around the country considered ballot measures on a number of divisive social issues, with Maine and Maryland becoming the first states to approve same-sex marriage by popular vote while Washington state and Colorado legalized recreational use of marijuana.
From the beginning, Obama had an easier path than Romney to the 270 electoral votes needed for victory. The most expensive campaign in history was narrowly targeted at people in nine battleground states that held the key to victory, and the two sides drenched voters there with more than a million ads, the overwhelming share of them negative.
Obama claimed at least seven of the battleground states, most notably Ohio, the Ground Zero of campaign 2012. He also got Iowa, New Hampshire, Colorado, Nevada, Virginia and Wisconsin, and he was ahead in Florida. Romney got North Carolina.
Overall, Obama won 25 states and the District of Columbia and was leading in too-close-to-call Florida. Romney won 24 states.
It was a more measured victory than four years ago, when Obama claimed 365 electoral votes to McCain's 173, winning with 53 percent of the popular vote.
Obama was judged by 53 percent of voters to be more in touch with people like them. More good news for him: Six in 10 voters said that taxes should be increased. And nearly half of voters said taxes should be increased on income over $250,000, as Obama has called for.
Obama's list of promises to keep includes many holdovers he was unable to deliver on in his first term: rolling back tax cuts for upper-income people, immigration reform, reducing federal deficits, and more.
A second term is sure to produce turnover in his Cabinet: Treasury Secretary Timothy Geithner has made it clear he wants to leave at the end of Obama's first term but is expected to remain in the post until a successor is confirmed. Secretary of State Hillary Rodham Clinton, Obama's rival for the presidency four years ago, is ready to leave too. Defense Secretary Leon Panetta isn't expected to stay on.
To the end, the presidential race was a nail-biter. About 1 in 10 voters said they'd only settled on their presidential choice within the last few days or even on Election Day, and they were closely divided between Obama and Romney. Nearly 1 percent of voters went for Libertarian Party candidate Gary Johnson, who was on the ballot in 48 states.
In an election offering sharply different views on the role of government, voters ultimately narrowly tilted toward Obama's approach.
"We have seen growth in the economy," said 25-year-old Matt Wieczorek, a registered Republican from Cincinnati who backed the president. "Maybe not as fast as we want it to be, but Obama has made a difference and I don't want to see that growth come to an end."
Notwithstanding his victory, Obama will lead a nation with plenty of people who were ready for a change.
"The last four years have been crap," said 73-year-old Marvin Cleveland, a Romney supporter in Roseville, Minn. "Let's try something else."