President Obama secured a second term by preserving much of the diverse mosaic of voters who rallied around him four years ago, overcoming weakened support in his coalition.

Women, Hispanics and Asian-Americans, voters under 45, liberals and moderates, those living in the Northeast and the West, and urban dwellers gave a majority of their votes to Mr. Obama. His opponent, Mitt Romney, lost with a far narrower and less diverse band of support — mostly men, voters 45 and older, conservatives, Southerners, evangelical Christians and married voters. The gender gap — the difference between a candidate’s votes from men and votes from women — has been studied for more than 30 years. This election, women were 10 points more likely to support Mr. Obama than men were; four years ago women were 7 points more inclined to vote for him. But in this cycle an even starker imbalance — the marriage gap — eclipsed gender. Unmarried women went for Mr. Obama by 23 points over married women, up from 18 points in 2008.

Men, however, reverted to a familiar pattern this time, after splitting 49 percent for Mr. Obama and 48 percent for Senator John McCain four years ago. They were 8 points more likely to vote for Mr. Romney, and a majority of men over 30 were Romney voters.

By far, the economy was the most important issue to voters throughout this election season, and on Election Day, they split between the two candidates in terms of who could best handle the economy and the deficit.