Supporters cheer as President Obama delivers his victory speech in Chicago.

Chip SomodevillaGetty Images

Americans elected Barack Obama to a second term Tuesday, with the president capturing or on the verge of winning all of the key states that had been at the center of his hard-fought campaign against Republican Mitt Romney.

"Whether I earned your vote or not, I have listened to you," Obama said early Wednesday at a speech before thousands of supporters in Chicago. "I have learned from you. And you've made me a better president.

"And with your stories and your struggles, I return to the White House more determined and more inspired than ever about the work there is to do and the future that lies ahead," he said.

The president's victory came surprisingly easily, as he won seven of the eight key battleground states and was ahead in the eighth, Florida. By holding the "Midwest firewall" — including Ohio, Wisconsin, Iowa and Michigan — the president handily defeated Romney.

Obama congratulated the former Massachusetts governor for a well-fought battle and said he looks forward to sitting down with Romney to chart a path for moving the country forward.

For his part, Romney conceded graciously.

"The nation, as you know, is at a critical point," Romney said to supporters at the Boston Convention Center. "At a time like this, we can't risk partisan bickering and political posturing. Our leaders have to reach across the aisle to do the people's work, and we citizens also have to rise to the occasion."

To wildly cheering crowds, he said, "Like so many of you, [GOP vice presidential nominee] Paul [Ryan] and I have left everything on the field. I so wish, I so wish that I had been able to fulfill your hopes to lead the country in a new 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."

Andrew Kohut, president of Pew Research Center, called it "a topsy-turvy campaign from beginning to end. ... And it ended in a topsy-turvy way."

Obama's victory comes despite the desultory state of the economy. The president lost ground over his 2008 victory in almost all demographic groups — whites, women and men, independents and even young people. But even those losses were not enough to knock him from the presidency, and part of that, according to Kohut, had to do with likability.

"Fifty-three percent of people said they approved of how Obama handled his job," Kohut says. "And a president with that kind of approval rating doesn't lose his job."

Romney never recovered from two negative perceptions: that as head of Bain Capital, he cared more about profits than jobs; and his "47 percent" comment, when he suggested that nearly half of Americans see themselves as "victims" and expect the government to support them.

It is not yet clear that the president will win the popular vote. Still, if trends continue, he is likely to.

"The most surprising thing was that the move toward the president was as distinctive as it was in the final days of the campaign," NPR Political Editor Ron Elving said.

In recent days, polls showed Obama gaining momentum in battleground states. And if trends hold, it is possible that the president will win all eight of them.

How The Vote Fell

In the final moments of the race, each candidate had advantages and disadvantages.

Romney had a clear edge among men, especially white working-class men who make up much of the vote in battleground states such as Ohio and Wisconsin. He led among older voters, as well as independents, though by smaller margins than polls during the campaign indicated. Independents have voted Republican in every presidential race since 1952, with the exception of 1964 (Johnson vs. Goldwater) and 2008, when Obama swept them in a wave of hope and change.

The president, however, fought back with overwhelming force. He won the female vote by large margins, even after women had cooled on him in the wake of his first, lackluster debate. Minorities — and especially Latinos, who factor large in swing states such as Florida, Colorado and Nevada — were firmly in the president's camp. One big trend in this campaign was the strong turnout among Latinos. Young people are also loyal to the president, although not quite as enthusiastically as in 2008.

Undecided voters — whom Romney was counting on in swing states — did not break for the challenger as he had hoped, robbing him of a wavelike victory of the kind that benefited Ronald Reagan in 1980.

The States That Mattered — And Didn't

Some of the predictions were spot on — that Ohio would be critical to an Obama win — but others collapsed with a loud thud.

As predicted, the Midwest became the path to victory — in particular, holding the battleground states of Ohio, Wisconsin and Iowa. Obama also kept Pennsylvania in his column, even as Romney tried to expand the contested states with a flurry of campaigning there in recent days.

Ohio: With its 18 electoral votes, Ohio was a must-win — and in this state, the president's bailout of the auto industry paid off. In the north, the auto industry bailout has driven the unemployment rate below the national average, and voters are rewarding the president. This more than compensated for voters in the southern part of the state, who are more socially and religiously conservative, and who have been hit hard economically, particularly in the coal industry.

Wisconsin: With 10 electoral votes, Wisconsin leaned toward Obama from the start, although Romney briefly had some traction when he selected favorite son Ryan to be his running mate. That enthusiasm ebbed, and Wisconsin was one of the few states that did not give Romney a bump after the first presidential debate in October. Wisconsin has not voted for a Republican presidential candidate since 1984.

Iowa: The state's six electoral votes completed the Midwest battleground strategy. In recent years, Iowa has voted for the Democratic presidential nominee, with the exception of George W. Bush in 2004. Obama benefited from the Latino vote and strong union support.

Virginia: As it turned out, the president did not need Virginia's 13 electoral votes — but he won them anyway. Romney had polled ahead of Obama for the latter part of the campaign, but that support softened in the days before the election. The fight here was between fast-growing northern Virginia, a Washington, D.C. suburb with young urbanites who vote Democratic, versus much of the rest of the state: rural pro-gun conservative.

Florida: With its 29 electoral votes, Florida is too close to call. But it doesn't matter. The state has three political identities: The south, including Miami, is diverse and, with the exception of an aging and shrinking Cuban population, leans heavily Democratic. The north, including the Panhandle, is socially and religiously conservative, with a strong military presence. People in the central part of the state — the Tampa-Orlando-Daytona Beach-I-4 corridor — are the definition of swing voters. And currently it appears they are swinging toward the president.

Ups And Downs

This campaign began with Americans distinctly tepid about their choices. Democrats said they were disappointed with President Obama's performance, smarting from the weak economy and frustrated that he seemed to have forgotten the poor in favor of the middle class.

Republicans, too, were cool to their candidate. In fact, until springtime, evangelicals, who make up a large part of the Republican base, flirted with a number of candidates whose chief characteristic seemed to be that they were not Mitt Romney.

But the last two months turned into a "roller coaster ride," analyst Larry Sabato says. Each candidate made strategic errors. The first bit of excitement arrived in mid-September, in the form of a leaked tape of Romney saying that 47 percent of Americans "who will vote for the president no matter what," are "dependent upon government ... believe they are victims" and do not pay taxes.

Then, two weeks later, Obama stumbled throughout the first debate. The president looked like a boxer on the ropes taking blows from an aggressive Romney; he even failed to land a punch on Romney with an attack on Romney's 47-percent comment. This erased the president's yawning lead in the polls, and the horse race was on.

"What Romney accomplished in the first debate was that he stood up on a stage with President Obama and made it clear he was at least his equal," says Thomas Riehl, a senior vice president of YouGov, an online polling firm. "You could imagine a Romney presidency and there wasn't much that was very threatening about that."

But Romney's good fortunes were arrested by the weather. Hurricane Sandy served as a circuit breaker that cut into whatever momentum Romney had generated.

"This was kind of an October surprise," says Alan Abramowitz, a political scientist at Emory University. "It gave the president an opportunity to act presidential, to act like a commander-in-chief."

As Obama visited devastated parts of New Jersey and New York — as he received glowing praise from New Jersey's Republican governor, Chris Christie, and then an endorsement from New York's mayor, Michael Bloomberg — Romney was forced to the sidelines, at least temporarily. Those television shots of the president impressed voters: The Pew poll found that nearly 7 in 10 likely voters — and 63 percent of swing voters — approved of the way the president handled the disaster.

In his acceptance speech, Obama seemed to look ahead to the battles he will surely face with a divided Congress and sometimes hostile House Republican leadership.

"I believe we can seize this future together because we are not as divided as our politics suggest," the president said. "We're not as cynical as the pundits believe. We are more than the sum of our individual ambitions, and we remain more than a collection of red states and blue states. We are and forever will be the United States of America, and together, with your help and God's grace, we will continue our journey forward and remind the world just why it is that we live in the greatest nation on Earth."

Those words — that America is not divided into red states and blue states — were an echo of the hopeful sentiments that catapulted Obama to national prominence during his speech at the 2004 Democratic National Convention. Now the president is seasoned enough to know that the journey ahead will be jarring and tumultuous, even if he does speak with a new mandate from the American people.