The day before he won the Republican primary in an Alabama Senate race, former Judge Roy Moore took to the stage for a last-push campaign rally at a farm in southern Alabama.

"For whatever reason, God has put me in this election at this time and all of the nation is watching," Moore told the crowd, according to AL.com. Moore then pulled a pistol out of his pocket and waved it in the air to rapturous applause.

Whether it was God or the gun, Moore won. He’ll go onto face Democrat Doug Jones on Dec. 12 in a general election Moore’s overwhelmingly expected to win.

But there was more at stake than just the careers of Moore and incumbent Sen. Luther Strange, who lost tonight, in this Alabama Senate primary. Here are three winners and three losers from Roy Moore’s victory on Tuesday.

Winner: Evangelical Christians

No current member of the US Senate has views on Christianity’s role in public life that resemble Moore’s. And no member of the US Senate would be as strong an advocate for evangelicals who believe in the supremacy of Christianity in America.

The Republican’s ambition isn’t merely for the government to carve out a space for free religious exercise, as many conservatives demand; instead, he argues that Christian principles — or, more accurately, Moore’s interpretation of Christian principles — should provide the foundation for, and even supersede, the laws of men. This is the common through-line of his career, and he acknowledges it as such.

“Moore’s ideology is an express belief that God’s law and his interpretation of God’s law stand on top of man’s law,” said David Dinielli, deputy director of the Southern Poverty Law Center, who has tracked Moore’s career for years. “It’s an ideology that would allow those who think they know the unknowable and the mystic to impose their beliefs on everyone else.”

It’s worth taking a second to examine what this looks like in practice. Moore has claimed that Muslim communities in the US are operating under Sharia law and that the federal government should respond and protect Christians. He has written that Muslims like Rep. Keith Ellison (D-MN) shouldn’t be allowed to serve in Congress because Islam is incompatible with the US Constitution. Moore gained prominence in national conservative circles in 2003 for refusing to remove a massive plaque bearing the Ten Commandments that he had installed in his courthouse; he garnered national headlines again in 2015 for refusing to issue same-sex marriage licenses after same-sex marriage was legalized.

Moore believes that the separation of church and state is itself a Christian idea. “That’s a Christian concept,” he told me after a rally in Alabama this August of the ability to worship according to one’s conscience. “It’s not a Muslim concept. Go to Saudi Arabia. Go to Afghanistan, Iran, Sudan, and be a Muslim, and see if you can exit that faith without consequences. You can’t do it. You understand? Understand that it’s a Christian concept.”

The Hill’s Reid Wilson makes clear just how much Moore owes his rise to religious voters. Despite trailing in all the polling, Strange actually ran ahead of Moore by 20 points among non-evangelical Republican voters. Several prominent national evangelical ministers have endorsed Moore. "He doesn't have to say he's associated with the church," Steve Flowers, a longtime Alabama political analyst, told Wilson. "It is the only issue he has."

After the rise of the clearly non-religious Trump, some analysts speculated that Christian conservatism had ebbed as a political force on the right. Moore’s rise suggests otherwise. At the very least, his victory would give a new national platform to amplify evangelical Christians and religious conservatives who want a true believer on Capitol Hill.

Winner: Trumpism

President Donald Trump was a loser in this election (I’ll get to this later), but Trumpism — the forces that powered Trump to the top of the Republican presidential field, and then carried him into the White House — was very much revealed and reinforced as a potent force by Alabama’s Republican primary election.

“In the primary, Trump was very much able to play quite successfully on being an outside figure and trashing the party for not standing up enough to Obama. That sentiment hasn’t really gone anywhere,” said Dave Hopkins, a political scientist at Boston College, about Moore’s victory.

Before the Alabama election, it was possible to imagine that Trump’s presidency would help take the wind out of the fervent rightward shift of American politics. For years, polling has consistently showed deep dissatisfaction among the Republican base with the party’s congressional leadership and institutional strongholds — a phenomenon that Hopkins says took off under George Bush but dramatically intensified under President Barack Obama.

Moore proved that lane is still wide open to run against DC Republicans — even if the fog of scandal surrounding Strange’s appointment to the Senate seat made Moore’s job easier.

Moore ran to Strange’s right on certain issues — immigration, guns, God — and wed that critique to one about the fecklessness of McConnell and House Speaker Paul Ryan. Despite losing Trump’s endorsement, Moore vowed to faithfully enact the president’s agenda; he and his allies have characterized Strange as soft on immigration and succumbing to “amnesty” for undocumented immigrants. Moore made claims as late as December 2016 questioning whether President Obama is a natural born citizen; he’s played footsie with white supremacist groups. (Does any of this sound like Trumpism to you, too?)

“You might have thought that a Trump presidency and having Republicans control Congress would relieve that pressure-valve — that with Hillary and Obama off the scene, some of that anti-establishment, anti-Republican leadership sentiment would dissipate,” Hopkins said. “What we’re seeing in Alabama is that that’s not the case.”

The parallels have limitations, of course. Moore’s rise was explicitly tied to religious ferment; Trump’s was not. On the campaign trail, Trump toned down Republican promises to gut the social safety net and even offered critiques of the American foreign policy establishment; in my interview with him, Moore offered a stark nationalistic and militaristic vision and expressed a desire to cut Medicare. Moore can quote the Founding Fathers at length; Trump ... doesn’t seem likely to have that rhetorical skill set in his repertoire.

But there’s a clear overlap, too. You can see it in Moore’s list of endorsements. Moore may have been snubbed by Trump, but the judge was aided by many of the big names that vouched for the president’s campaign — Steve Bannon appeared at a rally with Moore Monday night; Breitbart has gone all-in on vouching for Moore in the election; the British politician behind “Brexit,” Nigel Farage, has campaigned for Moore. Those endorsing the former judge include conservative media rockstars Ann Coulter, Sean Hannity, and Mark Levin — all big Trump backers in the GOP primary.

Trump may have himself been convinced to endorse an “establishment” candidate backed by the Republican business types in the Chamber of Commerce. But the believers in Trumpism — and the threat they seek to pose to establishment Republicans — may be the biggest winners of the race.

Winner: Democrat Doug Jones

Democratic nominee Doug Jones is almost certainly going to lose the Dec. 12 general election against Moore. Republicans outnumber Democrats in the state about five to three; Democrats haven’t won a presidential race in the state since 1976.

But Moore — who was once confined to the far-right fringe of conservative politics in Alabama — at least opens up the possibility that some unknown sequence of events will give Democrats hope. Before Moore’s lock on the nomination, Jones’ chances were probably zero. Now, his chances may be more than zero.

The Center for Politics’s Kyle Kondik said Tuesday afternoon he would move the race’s rating from “safe Republican” to “likely Republican” should Moore win.

And, indeed, some Republicans I interviewed in a reporting trip to Alabama saw Moore as a bridge too far. “That guy Roy Moore is way, way out there. He won’t even defend the rule of law,” Republican James Follett, 61, told me outside a Strange event at a Birmingham diner. “He wants to follow his judgment — not the judgment of the Supreme Court.”

Of course, there’s ample reason to be skeptical Democrats can do much more than send beyond some strong fundraising emails in the state. Jones has a pretty strong general election CV — he’s a moderate former US attorney most famous for prosecuting the white supremacists responsible for Birmingham’s 16th Street Baptist Church bombing case. And facing a brutal 2018 Senate map, Democrats are going to look for any opening they can find, meaning Jones may benefit from money from the national party.

It’s an uphill battle, to be sure. He’s still a Democrat in the state of Alabama in 2017.

“Moore would enter the general election as a significant favorite,” Kondik said. “Democrats haven’t won more than 40 percent of the vote in an Alabama Senate race since 1996.”

Loser: Donald Trump

President Donald Trump loves to win.

Today, his candidate lost.

It’s worth stressing that Trump didn’t simply tacitly agree to endorse Strange and then keep his head down throughout the election. Instead, Trump gambled big on his ability to influence the outcome of the Republican primary, taking active steps that made the campaign more and more a test of his presidential coattails. Trump took to Twitter repeatedly to boost Strange. He recorded robocalls for the first round of voting, and called in to the Alabama radio show Rick & Bubba to boost Strange — his first radio interview since taking office, according to AL.com. He flew down to Huntsville for a rally urging Alabamans to back Strange.

Perhaps some of this was motivated by Trump’s sheer desire to win. "I'm 5-0 in these races. I want to make it 6-0," Trump said Monday, according to AL.com. (Trump also accidentally called him “Ray” Moore.)

But Trump may have inadvertently exposed the limits of his influence over Republican primary voters. (Perhaps sensing the limits of his endorsement, he said at Friday’s rally, “Maybe I made a mistake” of Strange, already distancing himself from the coming loss.) Moore didn’t exactly distance himself from Trump personally (he promised to be a close ally of the president), but his victory demonstrates that Republican politicians can lose the president’s support and still come out on top.

“If Strange loses, it makes Trump look weak,” said Hopkins, of Boston College, before the final results came in. “And as we all know, Trump doesn’t like looking weak.”

Loser: Mitch McConnell

Mitch McConnell and his allies in the Republican establishment spent four months and more than $10 million trying to defeat Moore. In the process, they may not have just wasted a ton of money, but also created a new and remarkably powerful antagonist — one who will arrive in Washington owing the majority leader nothing.

If Moore wins the general election in December — as he is likely to do — and heads to DC, McConnell’s already fiendishly difficult whip count on major contentious issues is likely to grow only tougher. McConnell already faces an insurrectionist caucus on his right flank — most notably, from Sens. Rand Paul (KY), Mike Lee (UT), Ted Cruz (TX) — that believes the Republican establishment is too eager to compromise with Democrats. That faction may have just won a powerful and strident new ally.

Moore’s left no doubt about this. As he wrote in a recent fundraising email: "Judge Roy Moore in the U.S. Senate means the END of Mitch McConnell's reign as Majority Leader.”

The problem for McConnell goes far beyond simply losing one Senate Republican vote. Strange was inarguably tied to the Republican establishment in the race and struggled to shake that association. Moore’s victory is a big flashing sign the rest of the Republican caucus proclaiming that McConnell’s money can’t protect them from the anti-establishment tide — even with Trump’s endorsement.

“If you’re McConnell, you’re just peeing your pants over the prospect of a Moore win,” said Jim Manley, who served as a top aide to former Senate Majority Leader Harry Reid. “It’d be like adding a mini thermonuclear weapon in the Republican caucus — with very dangerous consequences for those trying to reach compromise.”

Loser: Alabama’s religious and racial minorities

Moore’s fundamentalism has helped him advance politically and build a base of support in Alabama. But it has scared those in the state who believe it puts them on the other side of Moore’s interpretation of God’s intentions.

Moore has made an already difficult life for gay Alabamans even harder, said Alex Smith of Equality Alabama, an LGBTQ rights organization. “We are very concerned about Moore becoming a senator,” Smith told me. “It’s been incredibly terrifying for LGBT folks in the state to watch.”

His election to the Republican nomination, and likely the Senate, is a huge message to LGBTQ Alabamans that they are still not considered equals by voters in the state.

Smith gave one example: Eight judges in Alabama are still not issuing marriage licenses to couples of either sex, following the guidelines of Moore’s order intended to prevent gay couples from wedding in the state.

New anti-LGBTQ legislation is on its way. In May, Republican Gov. Kay Ivey signed the Child Placing Inclusion Act into law. It allows some agencies to deny LGBTQ couples the ability to adopt children; Moore’s nonprofit, the Foundation for Moral Law, was instrumental in its passage, according to Smith.

"Being gay in the South isn't the easiest thing," said Russell Howard, director of Druid City Pride. "But it's a whole lot harder when you have someone with Mr. Moore's positions in power."

In a 2002 ruling in an adoption case, Moore wrote that homosexuality is an "inherent evil and if a person openly engages in such a practice, that fact alone would render him or her an unfit parent" and that homosexuality is “abhorrent, immoral, detestable, a crime against nature, and a violation of the laws of nature.”

Asked more recently by reporter Michelangelo Signorile about that ruling, Moore responded: “I quoted the law. The [British] common law designated homosexuality as an inherent evil. The Constitution is predicated on the [British] common law. I’m quoting the history of the [British] common law upon which our Constitution is based ... The court did not say that sodomy or homosexuality had any kind of public right.”

On religion, Moore has called Islam a “false religion” as recently as this July. He wrongly claimed to me that cities in America are under “Shariah law.” Hezekiah Jackson, president of Birmingham's NAACP chapter, argued it would be a mistake to view God as behind Moore’s politics. Instead, he said that Moore’s religiosity represented a clever front to appeal to identity groups — Christians, white men, heterosexuals.

"His thing is simple: He's a proponent of his own people,” Jackson said. “That's it. It's just obvious."