Updated

The ugly allegations, the searing national spotlight and a divided GOP all took their toll on Roy Moore last night as he lost in Alabama, an outcome that once bordered on unthinkable.

Moore, who fairly or unfairly came to personify a suspected predator in a #MeToo climate, seemed poised to overcome a negative wave with last-minute presidential backing. Few pundits were willing to place their chips on Democrat Doug Jones, given the emotional connection between Moore and his conservative base.

The degree to which the Alabama contest became a referendum on sexual misconduct, religious values, the media, the Republican Party, Donald Trump and the state itself was truly remarkable. Even Moore’s controversial past—twice getting kicked off the state Supreme Court for not following the law, saying homosexuality should be illegal—was largely overshadowed.

As Jones surged to 500 votes behind after 10 p.m. EST, and then suddenly a 11,000-vote lead, the cable pundits, with their color-coded maps, were suddenly grappling with a cliffhanger. By 10:30, Fox and CNN had called the race a narrow win for Jones.

I don’t believe there has been a state election that touched such a deep national chord since David Duke lost his bid for Louisiana governor in 1991.

But while the Jones squeaker will give a huge psychological boost to the Democrats, it’s hard to imagine that most Republican candidates without Moore’s considerable baggage would fare so poorly in Trump strongholds.

The reddest of red states, which the president carried by 28 points, was being asked to vote for a deep-blue Democrat. Even veteran Republican senator Richard Shelby urged his state not to vote for Moore.

The former judge responded to the harassment allegations by nine women—most of whom said he pursued or accosted them as teenagers—by flatly denying their accounts and largely staying off the campaign trail. He attacked the Washington Post, which published on-the-record interviews with the first four accusers, for its “terrible and disgusting article.” Moore campaign spokeswoman Janet Porter denounced the “lynch-mob media.”

According to early exit polls, almost six in 10 Moore voters say Trump’s support was a factor in their decision. And there was an uber-partisan split about the harassment allegations, with 89 percent of Jones voters calling them true and 86 percent of Moore voters branding them false (with 8 percent believing the accounts but supporting Moore anyway).

At first it seemed that the GOP would turn its collective back on Moore after he emerged victorious, with Steve Bannon’s help, in the primary. Trump said in a statement that if the allegations were true, Moore should step aside, and the RNC pulled its funding. Mitch McConnell spoke of leading an effort to expel Moore if he won.

But the president gradually came around to endorsing Moore, the RNC got back on board and Senate Republicans softened their expulsion talk. Moore looked like he was on track to win, and much of his party made the cold political calculation to get on the train.

Trump’s endorsement unleashed a wave of bad press for him as journalists demanded to know how he could dismiss the allegations by the nine women. And this in turn allowed the press to revive the allegations of the women who accused candidate Trump of harassment, which he has denied. Several of them appeared on Megyn Kelly’s NBC show.

And so the Moore race became a referendum on everyone involved, including evangelical voters in Alabama who stuck by him. Virtually the entire mainstream media, including the Wall Street Journal’s conservative editorial page, was highly critical of Moore.

The chatter on the tube before the returns were in was that the Democrats would win either way, defeating Moore or having a Republican poster child to run against through 2018. But now they’ll have to settle for an extra Senate seat.