Democrat Doug Jones won the special Senate election in Alabama on Tuesday — easily the biggest political upset of the Trump era to date.

As of midnight Tuesday, Republican Roy Moore, a former state Supreme Court chief justice, was refusing to concede, instead seeking a recount.

But virtually no one outside Moore’s direct circle of advisers believes that effort will be successful. Even President Trump Donald John TrumpOmar fires back at Trump over rally remarks: 'This is my country' Pelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Trump mocks Biden appearance, mask use ahead of first debate MORE has tweeted his congratulations to Jones.

ADVERTISEMENT

Who were the big winners and losers from the most dramatic special election in years?

WINNERS

The Democratic Party

This was a breathtaking result that will lift Democratic spirits nationwide.

The party had suffered disappointments in special elections to the House earlier this year, deepening the gloom from Hillary Clinton Hillary Diane Rodham ClintonButtigieg stands in as Pence for Harris's debate practice Senate GOP sees early Supreme Court vote as political booster shot Poll: 51 percent of voters want to abolish the electoral college MORE’s shocking loss to Trump in November 2016.

Democrats were mostly circumspect going into Tuesday, perhaps because the mere idea of winning in deep-red Alabama seemed so implausible.

But Jones did it, becoming the first Democrat to clinch a Senate win in the state since 1992.

ADVERTISEMENT

The result clearly puts control of the Senate in play in 2018.

And even though Moore had large and unique liabilities, there are a lot of Republicans who just became a lot more nervous about the political zeitgeist.

Black voters

African-American voters were the key to Jones’s victory.

The Democrat ran up huge margins in Alabama’s most heavily black counties. Black voters cast 29 percent of all votes, according to exit polls. They had cast 28 percent of all ballots for then-President Barack Obama Barack Hussein ObamaMichelle Obama and Jennifer Lopez exchange Ginsburg memories Pence defends Trump's 'obligation' to nominate new Supreme Court justice The militia menace MORE in the 2012 presidential election in the state.

Politicians, including Rep. John Lewis John LewisDemocrats urge Biden to resist filibuster, court-packing calls Rep. Bill Pascrell named chair of House oversight panel The Hill's Campaign Report: Biden goes on offense MORE (D-Ga.) and Sen. Cory Booker Cory Anthony BookerBipartisan praise pours in after Ginsburg's death DHS opens probe into allegations at Georgia ICE facility Democratic lawmakers call for an investigation into allegations of medical neglect at Georgia ICE facility MORE (D-N.J.), played their part in trying to maximize black turnout, as did some celebrities, including NBA Hall of Famer and Alabama native Charles Barkley.

Jones’s history was undoubtedly part of his appeal. In 2001 and 2002, he successfully prosecuted two Ku Klux Klan members for the infamous 1963 Birmingham church bombing that killed four black girls.

But it seems certain that many African-American voters were also keen to deliver a dual rebuke to Moore and Trump.

The pivotal nature of the black vote in the special election comes as a powerful rebuttal to those within Democratic ranks who have argued that the party is too focused on “identity politics.”

Jones thanked black voters during his victory speech and also alluded to Alabama’s anguished racial history.

“We’ve usually taken the wrong fork,” he said. “Tonight, ladies and gentlemen, you’ve taken the right road.”

Roy Moore’s accusers: Leigh Corfman, Beverly Young Nelson and others

The women who accused the Republican nominee of molestation and sexual assault were apparently motivated by profound and personal concerns, rather than a desire for political gain.

Even so, it would have been a fresh trauma for them if Moore had become a U.S. senator in spite of their allegations.

ADVERTISEMENT

Some measure of vindication was theirs on Tuesday.

Senate Majority Leader Mitch McConnell Addison (Mitch) Mitchell McConnellPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Senate GOP aims to confirm Trump court pick by Oct. 29: report Trump argues full Supreme Court needed to settle potential election disputes MORE (R-Ky.) and Sen. Richard Shelby Richard Craig ShelbySenate GOP eyes early exit Dems discussing government funding bill into February GOP short of votes on Trump's controversial Fed pick MORE (R-Ala.)

McConnell supported GOP Sen. Luther Strange Luther Johnson StrangeSessions hits back at Trump days ahead of Alabama Senate runoff The biggest political upsets of the decade State 'certificate of need' laws need to go MORE, who was appointed in February following Attorney General Jeff Sessions Jefferson (Jeff) Beauregard SessionsGOP set to release controversial Biden report Trump's policies on refugees are as simple as ABCs Ocasio-Cortez, Velázquez call for convention to decide Puerto Rico status MORE's confirmation, over Moore in the special election's Republican primary. The majority leader made no secret of his distaste for the former judge, even after Moore became the GOP nominee.

McConnell allies painted Moore as the latest in a line of unelectable candidates who appealed only to grass-roots conservatives. They cited figures like Delaware’s Christine O’Donnell and Missouri’s Todd Akin, who lost winnable Senate races in the 2010 and 2012 cycles, respectively.

Shelby, the senior GOP senator in the state, spent the last weekend of the campaign telling CNN’s “State of the Union” that he had written in the name of another Republican because he could not bring himself to vote for Moore.

That was a sizable political risk, but one that ultimately paid off.

Sen. Cory Gardner Cory Scott GardnerOvernight Health Care: US coronavirus deaths hit 200,000 | Ginsburg's death puts future of ObamaCare at risk | Federal panel delays vote on initial COVID-19 vaccine distribution The Hill's Campaign Report: GOP set to ask SCOTUS to limit mail-in voting Senate GOP sees early Supreme Court vote as political booster shot MORE (R-Colo.) and the National Republican Senatorial Committee (NRSC)

ADVERTISEMENT

At one point, both the Republican National Committee (RNC) and the GOP’s Senate campaign arm, the NRSC, had said they would provide no backing for Moore because of the accusations of sexually predatory behavior against him.

The RNC reversed itself after Trump made plain his support for Moore. But Gardner insisted that the NRSC, which he chairs, would not follow suit.

Gardner told The Weekly Standard that his group would “never” endorse Moore, adding, “I won’t let that happen.”

That looks like a smart decision now.

Sen. Cory Booker (D-N.J.)

Booker, a potential 2020 presidential candidate, visited the state in the closing days, campaigning for Jones and highlighting his own family’s ties to Alabama.

Few would claim that Booker’s influence on its own made the difference. But his visit has boosted his profile, and he is now associated with a historic Democratic victory.

ADVERTISEMENT

That will do him no harm, especially since the jockeying for position for 2020 is already underway.

The New York Times’s Needle of Prediction

The needle graphic used by the Times became the focus of much social media comment early in the evening — especially from anguished liberals who recalled its wild and abrupt swing from Clinton to Trump during the night of the presidential election.

This time, though, the needle’s early movement pointing toward an upset Jones victory proved accurate.

LOSERS

President Trump

Tuesday was a very bad night for Trump, capping a miserable involvement in Alabama politics.

The president was first persuaded to endorse Strange over Moore during September’s Republican primary, against his populist instincts.

He smarted over that misjudgment, then backed Moore with increasing vigor in the closing stretch of the race.

He penned tweets warning Alabamians against voting for Jones, recorded a robocall for Moore and held a rally just across the state line in Pensacola, Fla., on Friday night.

Moore’s defeat is a startling slap in the face for the president from a state he won by almost 30 points over Clinton.

The result could also accelerate the movement of Republican lawmakers away from him as they seek to safeguard their own political futures.

Stephen Bannon

Bannon went all-in on Moore, visiting the state to campaign for him. Breitbart, the news organization helmed by Bannon, at times resembled an adjunct of the Moore campaign.

Now the result has buttressed the anti-Bannon case often heard among Washington Republicans — in short, that the president’s former chief strategist promotes candidates who are unelectable and greatly exaggerates his own strategic skills.

Before the results were known on Tuesday evening, a former chief of staff to McConnell, Josh Holmes, tweeted a sarcastic thank-you to Bannon “for showing us how to lose the reddest state in the union.”

The pugnacious Bannon will live to fight another day, and he still has the president’s ear. But this was a major setback.

The Republican National Committee (RNC)

The RNC’s decision to come off the sidelines late in the race and get behind Moore backfired spectacularly.

Inside the Beltway, the organization’s defenders argue that it had little choice but to back Moore once Trump had done so.

But the bigger picture is one in which the national party first refused to back an alleged child molester, then decided to do so after all, and then lost anyway.

That’s a debacle by any standard.

The Republican agenda

Once Jones is seated, the GOP’s thin majority in the Senate will be reduced still further. The party will control just 51 of the upper chamber’s 100 seats.

The Republican push for tax reform should not be affected, since McConnell had already indicated that the winner in Alabama would not be seated before the end of the year.

But passing any further legislation just got significantly more complicated for the GOP.

The religious right

Evangelicals had, for the most part, remained foursquare behind Moore, both in Alabama and beyond.

Billy Graham’s son, Franklin Graham, tweeted early on election day that he was “praying for Roy Moore.”

But religious conservatives weren’t enough to bring Moore over the finish line — a reminder that the power of the religious right, even in such a socially conservative state as Alabama, isn’t guaranteed to carry all before it.