Barack Obama was elected to a second presidential term Tuesday, defeating Republican Mitt Romney by reassembling the political coalition that boosted him to victory four years ago, and by remaking himself from a hopeful uniter into a determined fighter for middle-class interests.

Obama, the nation’s first African American president, scored a decisive victory by stringing together a series of narrow ones. Of the election’s seven major battlegrounds, he won at least six.

“While our journey has been long, we have picked ourselves up,” Obama told a cheering crowd of supporters in his home town of Chicago early Wednesday morning. “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.”

He said he intends to sit down with Romney in the weeks ahead to talk about how the two can work together.

Obama also made an oblique reference to the hard, negative edge of his campaign, saying that even this bitter election was something to be envied in nations around the world that enjoy fewer freedoms: “These arguments we have are a mark of our liberty.”

His election capped a night of gains for the once beaten-down American left. Democrats Tammy Baldwin in Wisconsin and Elizabeth Warren in Massachusetts won Senate races, as the party kept control of that chamber. Liberal causes also won in several states: Maryland and Maine became the first to legalize same-sex marriage by popular vote. Colorado and Washington passed laws that legalized some marijuana use.

Romney, a former Massachusetts governor, had built his campaign around the single contention that the U.S. economy is battered and adrift because of Obama’s failures, and that his business experience uniquely qualified him to fix it.

In the end, that wasn’t enough, in part because the economy undermined his argument by showing signs of improvement. Just weeks before Election Day, the national unemployment rate dropped below 8 percent for the first time since Obama took office.

Voters also did not warm to Romney. Even after many months and millions of dollars put toward trying to make him look good, exit polls showed that just as many voters trusted Obama to handle the economy as trusted Romney.

“This is a time of great challenges for America, and I pray that the president will be successful in guiding our nation,” a slightly hoarse Romney told his supporters in Boston early Wednesday morning. He said he and his running mate, Rep. Paul Ryan (Wis.), had left “everything on the field,” adding: “I so wish that I had been able to fulfill your hopes.”

As of early Wednesday, Florida was too close to call — but also irrelevant, as Obama had passed the threshold of 270 electoral votes.

Romney was beaten by a different Obama than the one who defeated Republican Sen. John McCain (Ariz.) four years ago. Back then, Obama had run as a symbol of limitless hope.

This year, he ran as a symbol of hope’s limitations.

The president no longer pledged to sweep away Washington’s old partisan politics. He had tried that and was unable to do so. Now, he was pledging to plunge into those old politics and fight — battling Republicans whom Obama said favored the rich and waged a “war on women.”

As the election results came in, they showed that Obama’s promises had won over the groups for which he had promised to fight the hardest. He lost among white men by a large margin, as expected. But he performed strongly among African Americans, won by double digits among women, and routed Romney among a key and expanding demographic, taking 69 percent of the Latino vote in early exit polls.

Early returns also indicated that Capitol Hill’s balance of power would not change. Democrats would keep control of the Senate, after winning key races in Indiana, Massachusetts, Missouri and Virginia. Republicans were expected to keep the House, with virtually the same number of seats.

So now, ironically, the bruised Obama of 2012 has the job that the hopeful Obama of 2008 said he wanted: to conjure “change” out of a capital that is split and paralyzed by partisan battling.

For Romney, 65, Tuesday’s loss ends a personal marathon that began in June. But, in a broader sense, it started with his first presidential run, nearly six years ago. A longtime executive and investor, Romney ran a campaign that promised to bring a businessman’s clear-eyed conservatism to the problems of the U.S. economy.

He was helped immensely by a new breed of political action group, the free-spending super PACs that the Supreme Court legalized in 2010. Outside groups, including super PACs, poured an estimated $350 million into the race on his behalf, with pro-Obama groups spending an estimated $100 million.

For Romney’s family, it was the third unsuccessful attempt to capture the White House: Romney's father, George, a Republican governor of Michigan, ran in 1968.

But the upward course of the son’s campaign was a cold kind of victory.

He had spent years fighting a perception that he was too moderate, too malleable, for the swashbuckling, tea-partying modern GOP. But in this campaign’s final days, he became a bona-fide Republican hero.

At recent rallies, as many as 30,000 people roared his name. On Tuesday, during a last-minute trip to Pennsylvania, Romney stepped off his campaign plane in Pittsburgh and was surprised to see supporters cheering him from a parking garage.

Romney appeared moved and waved back without speaking. “That’s when you know you’re going to win,” he told a reporter as he walked to his motorcade.

Romney’s close loss was also a milestone for his religion, the Church of Jesus Christ of Latter-day Saints. Mormons had once been persecuted to the desert edge of American civilization. Now, with 15 of the church’s members in Congress, a devout Mormon had fallen just short of the White House.

In the immediate aftermath of the election, it seemed that three of Obama’s actions as commander in chief had played significant roles in his reelection.

One was his decision to bail out the U.S. auto industry. In Ohio, a battleground where that industry is a major presence, 59 percent of voters in early exit polls favored the bailout. Obama did better than usual there among a group he usually loses by a lot: white men without a college education.

Another key decision was Obama’s choice to offer some young illegal immigrants who were brought to the United States as children the temporary right to live and work in this country legally without the fear of being deported. In Florida, Obama won 60 percent of Latino voters, up three percentage points from four years ago, exit polls showed.

A third was Obama’s handling of Hurricane Sandy, which earned him plaudits from New Jersey Gov. Chris Christie (R), a major Romney backer. In early exit polls, 42 percent of voters said the hurricane was an important factor in their vote: More than 60 percent of them voted for the president.

Now, Tuesday’s victory illuminates the next arc of Obama’s career. In the past decade, he was transformed from an unknown Illinois state senator, to a U.S. senator, to a political cause, and then into a president who struggled to deliver on his promises of far-reaching hope and change.

Obama’s victory seems to guarantee that the landmarks of his first term — the Dodd-Frank financial reforms and the health-care law — will remain in effect. Romney said he wanted to repeal both.

It was difficult, even after months of campaigning, to say what Obama’s next big idea would be. He did not lay out a broad new agenda in the campaign. Instead, his vague slogan, “Forward,” was a sign that the election was about voters trusting him, rather than a set of specific ideas.

Already, Obama’s chief antagonists — the House’s leaders — have signaled that they do not intend to change. Whatever mandate Obama gained Tuesday, Speaker John A. Boehner (R-Ohio) said, the GOP got an equal mandate to oppose him.

“For two years, our majority in the House has been the primary line of defense for the American people against a government that spends too much, taxes too much and borrows too much when left unchecked,” Boehner said at a Republican event Tuesday night.

On Election Day, Boehner said, “they’ve responded by renewing our majority.”

On Tuesday, several states experienced problems with voting. Some voters in Pennsylvania reported that they were required to show identification, despite a judge’s ruling barring that practice in this election.

In New York and New Jersey, voting was disrupted by the aftereffects of Hurricane Sandy. New Yorkers waited in long lines at polling places that were consolidated because of storm damage. And some displaced New Jerseyans said the government was not following through on a promise to let them vote by e-mail.

This information-age Election Day — where “micro-targeted” e-mails replaced fliers, texted donations replaced checks and Twitter sometimes seemed to replace thought itself — began with a scene out of a Norman Rockwell painting.

The first votes were cast just after midnight, by two tiny New Hampshire burgs. Hart’s Location went for Obama, 23 votes to nine. Dixville Notch was tied, five to five.

As the rest of the country awoke Tuesday, the scenes at many polling places were altered by a trend toward early voting: Instead of lines, there were trickles. In Colorado, where more than 80 percent of the 2008 total had already voted, Lydia Leon showed up for tradition’s sake.

She always votes on Election Day. And, in the past, Leon and her husband, Leonard, canceled each other out — blue plus red making nothing. Last time, she was for Obama and he was for McCain. Not this year.

Leon blamed the president for an increase in the family’s insurance premium, and for the poor economy that has her sons working multiple jobs.

“This year, I had to agree with my husband,” she said. “Things didn’t work out the way I wanted.”

But, if Obama lost that one vote in the key battleground of Colorado, he kept another: In the Denver suburbs, Liz Smalley voted for George W. Bush in 2004, then Obama in 2008. In this election, she was bombarded by both sides.

“I’ve never seen anything like it, 10 calls a day for the last couple of weeks,” said Smalley, who was at a Great Clips hair salon with her 14-year-old twins before heading to the polls. “They finally got my cellphone, too.”

In the end, she stuck with Obama. Smalley said she didn’t think Romney was “really out for the good of everybody.” She also was turned off by the harshness of the anti-Obama yard signs in her normally civil, heavily Republican neighborhood near Lakewood.

“ ‘Vote for an American,’ stuff like that,” she said. “It’s too much.”

As Election Day proceeded, two vast political machines found themselves — at last — running out of things to do.

In Ohio, it was time for the flushing.

Flushing, in politics, is the process by which activists visit polling places and read through the posted lists of those who have voted. They cross those names off a master list of potential supporters.

Then they go after everybody else. At the Romney campaign office in Independence, Ohio, two of the designated flushers were the husband-and-wife team of Steve and Chris Biro. Both are 59, retired, Catholic, conservative and furious at Obama.

“I have some issues with what’s going on in this country right now,” Steve, a retired telephone company worker, said before departing for a polling station in a nearby community center. “It’s called communism.”

At the end of the campaign trail, Romney voted Tuesday morning in his home town of Belmont, Mass. Then, with swing-state polls leaning against him, he headed back out. Romney made a stop in Cleveland. Then he went to Pittsburgh, as part of a last-minute push for Pennsylvania.

Ryan made eleventh-hour stops in Cleveland and Richmond.

For Obama, there was no rerun of the old Election Day visual, the president pulling back the curtain in a voting booth. No need. Obama, too, had voted early.

On Tuesday, Obama played his traditional Election Day game of basketball in Chicago. Other players included campaign staff members, friends, and NBA Hall of Famer Scottie Pippen. Obama’s team won by about 20 points, one participant told reporters.

He also visited a Chicago field office. There, Obama made three calls to the most harassed constituency in the nation this year: swing-state voters.

When one Wisconsin woman picked up, however, he had a moment that might have put his win — and this long campaign — in perspective.

“This is Barack Obama,” he said.

But the woman at the other end of the phone didn’t recognize the name.

“You know, the president?”

Robert Barnes and Jon Cohen in Washington; Darryl Fears in Manchester, N.H.; Stephanie McCrummen in Boston; Felicia Sonmez in Pittsburgh; Susan Svrluga in Arlington; and Craig Timberg in Cleveland contributed to this report.