President Barack Obama handily defeated Gov. Mitt Romney and won himself a second term on Tuesday after a bitter and historically expensive race that was primarily fought in just a handful of battleground states. Obama beat Romney after nabbing almost every one of the 12 crucial battleground states.

The Romney campaign's last-ditch attempt to put blue-leaning Midwestern swing states in play failed as Obama's Midwestern firewall sent the president back to the White House for four more years. Obama picked up the swing states of New Hampshire, Michigan, New Mexico, Iowa, Virginia, Wisconsin, Colorado, Nevada, Pennsylvania, Minnesota and Ohio. Of the swing states, Romney picked up only North Carolina. Florida is still too close to call, but even if Romney wins the state, Obama still beat him in the Electoral College vote. The popular vote will most likely be narrower than the president's decisive Electoral College victory.

In a sweeping victory speech early Wednesday morning, Obama thanked every American who voted, and vowed to work with leaders from both parties to tackle the country's challenges.

"Our economy is recovering, a decade of war is ending, a long campaign is now over," he told a crowd of cheering supporters in Chicago. "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." Obama added he has "never been more hopeful about America. ... We're not as divided as our politics suggest. We remain more than a collection of blue states and red states."

In his speech, he offered clues to the policy goals of his second term, which included a deficit reduction plan that combines tax increases with spending cuts, a comprehensive overhaul of the nation's federal immigration laws and tax reform. He called on Republicans to join him in achieving those goals.

The battle for the White House between Obama and Romney divided the nation, causing, at times, bitter disputes between the parties. Obama urged his supporters to look beyond the fight of the past several months and defended the process of choosing a president.

Story continues

"I know that political campaigns can sometimes seem small, even silly," Obama said. "And that provides plenty of fodder for the cynics who tell us that politics is nothing more than a contest of evils or the domain of special interests. If you ever get the chance to talk to folks who turned out to our rallies and along the rope lines of high school gyms, or saw folks working late at campaign office or some tiny county a long way from home, you'll discover something else."

Romney conceded in Boston in a speech around 1 a.m. ET. "Like so many of you, Paul [Ryan] and I have left everything on the field. We have given our all to this campaign," Romney said. "I so wish that I had been able to fulfill your hopes to lead your country in another direction. But the nation chose another leader." Romney congratulated the president and his campaign on their victory.

The Obama victory marks an end to a years-long campaign that saw historic advertisement spending levels, countless rallies and speeches, and three much-watched debates.

The Romney campaign cast the election as a referendum on Obama's economic policies, frequently comparing him to former President Jimmy Carter and asking voters the Reagan-esque question of whether they are better off than they were four years ago. But the Obama campaign pushed back, blanketing key states such as Ohio early on with ads painting him as a multimillionaire more concerned with profits than people. The Obama campaign also aggressively attacked Romney on reproductive rights issues, tying Romney to a handful of Republican candidates who made controversial comments about rape and abortion.

The ads were one reason Romney faced a steep likeability problem for most of the race, until his expert performance at the first presidential debate in Denver in October. After that debate, and a near universal panning of Obama's performance, Romney caught up with Obama in national polls, and almost closed his favorability gap with the president. In polls, voters consistently gave him an edge over Obama on who would handle the economy better and create more jobs, even as they rated Obama higher on caring about the middle class.

But the president's Midwestern firewall—and the campaign's impressive grassroots operation—carried him through. Ohio tends to vote a bit more Republican than the nation as a whole, but Obama was able to stave off that trend and hold an edge there over Romney, perhaps due to the president's support of the auto bailout three years ago. Romney and his running mate, Paul Ryan, all but moved to Ohio in the last weeks of the campaign, trying and ultimately failing to erase Obama's lead there.

A shrinking electoral battleground this year meant that only 12 states were really seen as in play, and both candidates spent most of their time and money there. Though national polls showed the two candidates in a dead heat, Obama consistently held a lead in the states that mattered. That, and his campaign's much-touted get-out-the-vote efforts and overall ground game, may be what pushed Obama over the finish line.

Now, Obama heads back to office facing what will most likely be bitterly partisan negotiations over whether the Bush tax cuts should expire. The House will still be majority Republican, with Democrats maintaining their majority in the Senate.

The loss may provoke some soul searching in the Republican Party. This election was seen as a prime opportunity to unseat Obama, as polls showed Americans were unhappy with a sluggish economy, sky-high unemployment and a health care reform bill that remained widely unpopular. Romney took hardline positions on immigration, federal spending and taxes during the long Republican primary when he faced multiple challenges from the right. He later shifted to the center in tone on many of those issues, but it's possible the primary painted him into a too-conservative corner to appeal to moderates during the general election. The candidate also at times seemed unable to effectively counter Democratic attacks on his business experience and personal wealth.

"In the coming weeks and months I am looking forward to reaching out to leaders of both parties," Obama said.

He won't have much time to fulfill that promise. With tax hikes looming and a sequestration deal that will make enormous , automatic cuts in government funding, Congress and the White House must move quickly to find a compromise and put Obama's high-minded rhetoric into action.

Chris Moody contributed reporting from Chicago.