The detailed, on-the-record accounts from four women describing Roy Moore touching them in sexual ways or pursuing them when they were teenagers and he was in his 30s seemed like the kind of news that might force the Alabama U.S. Senate candidate to drop out of the Dec. 12 special election.

Moore could have withdrawn out of embarrassment or because he was worried about losing. He is in clear electoral danger: The average of five surveys conducted after the allegations became public has Moore leading Democrat Doug Jones by only 2 percentage points. And key figures in the national Republican Party are either distancing themselves from Moore or calling on him to leave the race.

But Moore is showing no signs of quitting, and he could still win for one simple reason: Alabama voters really do not like electing Democrats. Local Republican leaders in Alabama are standing by Moore, dismissing the four women’s stories but also emphasizing that they believe it’s absolutely necessary to put a Republican in this seat — a message that the state’s electorate may heed. It’s difficult — but not impossible — to see a path to victory for Jones.

Indeed, if you were looking for a state where a Republican candidate could survive such a huge scandal, it would be hard to pick a better one than Alabama. The last Democratic presidential candidate to win the state was Jimmy Carter in 1976. The last to reach even 40 percent of the vote was Al Gore in 2000. The last time a Democrat won a U.S. Senate race in Alabama was 1992. A Democrat hasn’t won a statewide race period since 2008.

Alabama’s demographics make the Democratic path to victory there extremely difficult. About 35 percent of Alabama residents are white evangelicals, a group that overwhelmingly votes for Republicans, and that’s a much larger share of the population than we see in the U.S. as a whole (17 percent). About 19 percent of Americans nationally live in what the U.S. Census defines as rural areas (which tend to lean heavily Republican), but 41 percent of Alabama residents live in these areas. Adults with at least a college degree, a Democratic-leaning bloc, accounted for just 32 percent of Alabama voters in 2016, compared to 40 percent nationally, according to Census figures.

But it’s not just a Republican-leaning state; Alabama’s electorate is also deeply polarized along both partisan and racial lines. In other words, the state has very few swing voters — voters who don’t reliably pick one party or the other and who might be swayed by, for example, the national political environment or what’s in the news. The state’s electorate is about 71 percent white and 26 percent black, with small numbers of other groups (e.g. Asians and Latinos). In 2012, the most recent election for which we have reliable figures on how different demographic groups voted in Alabama, Barack Obama won an estimated 94 percent of the black vote in that state, compared to just 16 percent of the white vote. (He won about 41 percent of the white vote nationally.) And it’s doubtful that Obama’s dismal showing among white voters was purely a result of his race, since Hillary Clinton lost by an even larger overall margin in the state in 2016 than Obama did in 2008 and 2012.

The black electorate in Alabama basically guarantees a Democratic pathway to about 35 percent of vote, but with such an entrenched electorate and so few swing voters, it’s very hard for a Democrat to get into the 40s, let alone win a majority.

So how can Jones, the former federal prosecutor running against Moore, win? Assuming December’s turnout rates among racial groups resemble the rates from past elections, Jones would need to win about 90 percent of the two-party black vote, about 35 percent of the two-party white vote and 70 percent of the nonwhite, nonblack two-party vote. Basically, Jones needs to secure a much, much larger percentage of the white vote than Obama did in 2012.

Or we could assess his path in geographic terms. First, let’s give Jones the areas Clinton won in 2016, starting with a group of small, rural, heavily black counties in central Alabama that are part of the so-called Black Belt. She also won the counties that include the state’s large cities, Montgomery County (Montgomery) and Jefferson County (Birmingham), the former of which is majority black. That got her to 34 percent of the overall vote.

Where might the rest of Jones’s vote come from? It’s usually not wise to compare primary elections with the general elections that follow, since those are two different electorates. But it’s worth looking at the September GOP primary between Moore and sitting Sen. Luther Strange. Since they didn’t support Moore originally, Strange’s voters might be more willing to abandon Moore in the general (or just stay home).

Moore won the primary, but his margin of victory was somewhat narrow (9 percentage points) in part because he was lost badly to Strange (by 17 points) in population-rich Jefferson County. Strange also won one of the counties (Shelby) next to Jefferson and Madison County in the north, home to the growing Huntsville area, where the Marshall Space Flight Center and one on the campuses of the University of Alabama is based. Moore, meanwhile, crushed Strange in non-urban areas.

Somewhat similarly, in 2012, Moore won his campaign to become chief justice of the Alabama Supreme Court for a second time, but he did so by less than 4 percentage points. His Democratic opponent, Bob Vance, ran up huge margins in Jefferson County (winning by 26 percentage points) and heavily black Montgomery County (winning by 42 points). Vance also won the Huntsville area, the Black Belt and Mobile County in the southwest, which is less evangelical and more black than the state as a whole.

So the path for Jones is probably:

Holding down Moore’s margin in rural counties (where many whites without a college degree live), or at least hoping that turnout in these counties is depressed. Winning by an overwhelming margin in the majority-black counties. Winning big in the urban areas around Birmingham, Huntsville, Mobile and Montgomery.

That is similar to the Democratic formula in many states, particularly Southern states. Indeed, the new surveys suggest Jones may be able to pull these ingredients together. In a JMC Analytics poll that had Jones ahead of Moore 48 percent to 44 percent overall, the Democrat was winning 40 percent of the two-party white vote and 92 percent of the two-party black vote.

Also, there are signs that some Republican voters may simply stay home in December. A Decision Desk HQ poll taken on Thursday (the day that the latest Moore news broke) showed a tied race in part because more than 10 percent of self-identified Republicans said they weren’t voting for either candidate, compared with fewer than 3 percent of self-identified Democrats who didn’t back Jones or Moore.

These first few polls conducted since the Moore news broke could represent just the beginning of his electoral deterioration. Polls taken immediately after Senate candidate Todd Akin used the phrase “legitimate rape” during the 2012 campaign underestimated his eventual slide in the polls compared to later surveys in the Missouri Senate race. On the other hand, Moore might be able to convince Alabama Republicans that a vote for him is a vote against Democrats, the media and cultural elites, and that the allegations he faces and the Washington Post story that first reported them are part a political attack against him. That appears to be his strategy in the wake of this controversy.

It would still be an upset if Jones won. This is Alabama. But considering Moore’s already weak standing and the recent accusations against him, it wouldn’t be a huge upset.