By Fred Backus and Jennifer De Pinto

In Alabama, Democrat Doug Jones eked out a narrow win against Republican Roy Moore, marking the first time a Democrat won a Senate seat in the largely Republican state in 25 years. Moore, who faced a series of allegations of sexual misconduct, nonetheless managed to retain the near unanimous support of members of his own party, as well as the strong support of conservatives and whites - particularly white evangelicals, white voters without college degrees, and white voters who live in rural areas. But Jones was buoyed by surprisingly strong turnouts among Democrats and African Americans, as well solid support from younger voters, moderates, and women. He also eked out a slight win among independents.

Although Moore voters disregarded both the veracity and importance of the allegations against him, most of those who voted for Jones said the allegations were probably true, and that it was an important factor in their vote. Slightly more voters had a favorable opinion of Jones (50 percent) than said that about Moore (41 percent), and exit polling showed Jones voters as more strongly behind their candidate: three in four Jones voters said they strongly favored him, compared to just over half of Moore backers who said the same about their candidate.

Get Breaking News Delivered to Your Inbox

Jones' victory is all the more remarkable in that it didn't rely on many Republicans defecting to the Democratic side. Less than one in 10 Republicans crossed party lines to vote for Jones. But Democrats -- who overwhelmingly favored Jones -- came out in stronger numbers, trailing Republicans in vote share by just six percentage points. And Independents - who make up just one in five voters in this highly partisan race -- also favored Jones by nine points: 52 percent to 43 percent.

The race divided along stark racial lines as well, with Moore winning the support of most white voters, and Jones getting the support of nearly all African Americans. At 28 percent, the percentage of blacks voting in Alabama equaled the percentage who turned out to vote in Barack Obama's bid for re-election in 2012, and more than nine in 10 black voters chose Jones. Jones also got about a third of the white vote, which is double the share Obama received in 2012.

There was a division by age and gender that was reminiscent of the recent governor races in Virginia and New Jersey. Younger voters voted Democratic in substantial numbers, with six in 10 voters under 45 supporting Doug Jones and most seniors voting for Roy Moore. In terms of gender, more than half of men voted for Moore, while most women voted for Jones. Jones' support from women was largely boosted by his support among African American women, 98 percent of whom backed him. White women backed Moore by about two to one.

And while conservatives and white evangelicals overwhelmingly supported Moore, Doug Jones had the strong support of liberal and moderate voters, who combined outnumbered conservatives by 10 percentage points. The contest in Alabama also represents a divide between largely black and Democratic urban centers like Birmingham -- which voted for Jones -- and rural areas of the state -- which voted for Moore.

President Trump -- who recently stepped into the race to endorse Roy Moore -- may have energized some Moore supporters: 53 percent of Moore voters said that their vote was in part to express support for Donald Trump. But support for Mr. Trump was surprisingly lackluster among the electorate in Alabama this year. While 48 percent of Alabama voters said they approved of the job he was doing as president, nearly as many - 47 percent - disapproved, including four in 10 who disapproved strongly.