Gallery

WASHINGTON (AP) -- President Barack Obama rolled to re-election Tuesday night, vanquishing former Massachusetts Gov. Mitt Romney and prevailing despite a weak economy that plagued his first term and put a crimp in the middle class dreams of millions.

“This happened because of you. Thank you” Obama tweeted to supporters as he celebrated four more years in the White House.

After the costliest—and arguably the nastiest—campaign in history, divided government seemed alive and well.

Democrats retained control of the Senate with surprising ease. Republicans were on course for the same in the House, making it likely that Speaker John Boehner of Ohio, Obama’s partner in unsuccessful deficit talks, would reclaim his seat at the bargaining table.

Romney led narrowly in the popular vote, with 47.5 million votes, to 47.3 million for Obama, with ballots counted in 70 percent of the nation’s precincts.

But Obama’s laserlike focus on the battleground states allowed him to run up a sizeable margin in the competition for electoral votes, where it mattered.

He won Ohio, Wisconsin, Virginia, Iowa, New Hampshire, Colorado and Nevada, seven of the nine battlegrounds where the rivals and their allies poured nearly $1 billion into dueling television commercials.

Romney was in Massachusetts, his long and grueling bid for the presidency at an unsuccessful end.

He won North Carolina among the battleground states. Florida remained too close to call.