Both parties are drawing lessons from Alabama as the smoke begins to clear from Tuesday’s stunning special election result.

Doug Jones became the first Democrat to win a Senate race in the state since 1992, defeating Roy Moore despite vigorous support for the GOP candidate from 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, who carried the state by almost 30 points in the 2016 presidential election.

Trump sought to distance himself from Moore on Wednesday, though many political insiders saw the result, at least in part, as a rebuke of the president.

“I said Roy Moore will not be able to win the General Election. I was right! Roy worked hard but the deck was stacked against him!” Trump tweeted on Wednesday morning.

ADVERTISEMENT

Later, in brief remarks at the White House, he told reporters, “I wish we would have gotten the seat.” Trump added, however, “A lot of Republicans feel differently. They’re very happy with the way it turned out.”

Moore, to be sure, had unique weaknesses — the worst being that he faced allegations of sexual assault against teenage girls. Moore also has a history of controversial remarks on other matters, from homosexuality to crime.

But Democrats see their win as part of a broader pattern. They say that a victory in Alabama was only possible because of voter enthusiasm, especially among the African-Americans and young people who form the bedrock of their party.

They say similar patterns have been seen in other elections since Trump took office.

Democratic candidates won gubernatorial contests in Virginia and New Jersey in November. Earlier in the year, Democrats did better than expected even as they went down in special House elections in solidly conservative districts in Georgia and Kansas.

“Yes, there were special elections we lost — but we outperformed,” said Karine Jean-Pierre, senior adviser and national spokeswoman for MoveOn.org, a progressive group.

A win against the odds in a deep-red state like Alabama gives Democrats heart for the political battles to come — particularly for the 2018 midterm elections. Democrats were widely expected to have been on the defensive in Senate contests, since their party has to protect more seats than Republicans.

“There is now a real chance of Republicans losing the Senate in 2018, which no one regarded as a serious possibility even a couple of weeks ago,” said Democratic pollster Mark Mellman, who is also a columnist for The Hill.

Mellman argued that the message from many of the elections held this year is that there is “an increased energy on the Democratic side, decreased energy on the Republican side and there is movement within some segments of the electorate from Republicans to Democrats.”

Those patterns were crystal clear in the data from Alabama.

Whereas a special election to the Senate would normally be expected to have much lower turnout than a presidential contest — especially among Democratic-leaning demographic groups — that simply didn’t happen in Alabama.

With 99 percent of precincts reporting as of noon Wednesday, Jones had racked up more than 671,000 votes — a total in the same ballpark as Democratic presidential nominee 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, who received about 729,000 votes in 2016.

By contrast, Moore’s tally of 650,000 votes was only about half of the total Trump received in the state.

The message is plain: Democratic voters showed up. Huge numbers of Republicans did not.

African-American voters in Alabama turned out as strongly on Tuesday as they did in 2012 for then-President Obama’s reelection. According to exit polls, black voters cast 29 percent of the total votes on Tuesday and 28 percent of the votes in 2012. (There was no official exit poll conducted in Alabama for the 2016 elections.)

Even Stephen Bannon, Trump’s former chief strategist and a fervent Moore backer, paid tribute to the capacity of Democrats to get their voters to the polls.

“One thing you’ve got to give a hats-off to: The [Democratic National Committee] came in here, slipped in here underneath the radar, and did an amazing job of organizing. What’s my favorite word? Ground game. Nice ground game,” Bannon told Breitbart’s editor-in-chief, Alex Marlow, on SiriusXM’s “Breitbart News Daily” on Wednesday.

Bannon’s Republican critics, however, will see that as excuse-making on the part of the controversial strategist. Establishment Republicans — especially those close to 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.) — excoriate Bannon for what they see as a tendency to promote unelectable candidates and exaggerate his own political skills.

Some Republicans in the Senate reacted with barely disguised glee to Moore’s loss.

Sen. Bob Corker Robert (Bob) Phillips CorkerHas Congress captured Russia policy? Tennessee primary battle turns nasty for Republicans Cheney clashes with Trump MORE of Tennessee, who has become a trenchant Trump critic, described the result as “a great night for America.”

In a hallway interview with reporters, Sen. Ron Johnson Ronald (Ron) Harold Johnson CIA found Putin 'probably directing' campaign against Biden: report This week: Supreme Court fight over Ginsburg's seat upends Congress's agenda GOP set to release controversial Biden report MORE (R-Wis.) ascribed Moore’s loss to the idea that “Alabamians didn’t want somebody who dated 14-year-old girls.”

Pressed as to whether the result offered a lesson for Bannon, Johnson said, “I hope he pays attention that you need good candidates to win in Senate races, yeah.”

Exit poll data on Tuesday showed a gigantic shift among people in the demographic and political center of the electorate, as well as enthusiasm among the Democratic base.

In 2012, Obama was edged out among Alabam voters who considered themselves “moderate” ideologically, losing the group to GOP nominee Mitt Romney by 5 percentage points. On Tuesday, Jones won self-described moderates by 49 points.

Obama lost voters who called themselves independent, rather than Republican or Democrat, by 52 points in 2012 in Alabama. Jones won them by 8 points.

Obama lost voters who had attended college by 30 points. Jones won them by 5.

Veteran Republican strategist John Stipanovich, a frequent Trump critic, asserted that Moore was “a terrible candidate.”

But he also said that the Alabama results fit the broader picture of an animated Democratic base overcoming a GOP riven by divisions between diehard backers of the president and a swath of more moderate Republicans who disdain him.

“In my judgment, the heart of that dynamic is Donald Trump and his unprecedented unpopularity,” said Stipanovich.

Democrats, meanwhile, are buoyed by the new political landscape.

“When you invest, you can get a win — even in a ruby-red state,” said MoveOn’s Jean-Pierre.

The Memo is a reported column by Niall Stanage, primarily focused on Donald Trump’s presidency.