Former Judge Roy Moore won the Alabama Republican Senate primary on Tuesday, defeating incumbent Sen. Luther Strange.

The race was called for Moore at around 9:30pm by the Associated Press.

BRAKING: Firebrand jurist Roy Moore wins Alabama GOP primary runoff for U.S. Senate, defeating Trump-backed incumbent. — The Associated Press (@AP) September 27, 2017

Moore’s victory is a big blow to both President Donald Trump and Senate Majority Leader Mitch McConnell, who threw their endorsements and more than $10 million toward securing the seat for Strange, who was appointed to it after Jeff Sessions vacated it to become Trump’s attorney general.

In a state as deeply conservative as Alabama — Republicans outnumber Democrats in the state about five to three — the victory means Moore will almost certainly be Alabama’s next senator. He will face Democrat Doug Jones in a general election on December 12.

If he makes it to Congress, Moore is likely to create major headaches for Republican leadership. A populist who believes in the supremacy of God’s law over man, Moore has addressed white supremacy groups, doesn’t believe Muslims can serve in Congress, and was twice reprimanded for defying federal court orders.

He has run a race heavy on God and guns; at a campaign event Monday night, the candidate pulled out his pistol onstage and waved it in the air — to wild applause from the crowd. Moore was joined at the rally by Phil Robertson, the star of the Duck Dynasty franchise; Steve Bannon, Trump’s former chief strategist and the executive chair of Breitbart; and Nigel Farage, the British politician who helped orchestrate Brexit.

“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. “It’s an ideology that would allow those who think they know the unknowable and the mystic to impose their beliefs on everyone else.”

Meet Roy Moore: the fire-and-brimstone judge likely to be Alabama’s next senator

Like Trump, Moore has a credible claim to being an outsider where his opponents do not. Strange was a Washington lobbyist for an oil company before becoming attorney general; Rep. Mo Brooks, who lost a first round of voting in the race in August, had been in the House since 2011.

“I’m not a politician. I don’t like politics,” Moore told supporters at a rally in August. “It’s what God has done through me.”

In an interview in August, Moore promised to restore Christianity to the Capitol, said he wanted to fight the rise of Islamic “Sharia law” in the US, and eagerly showed off his annotations on Joseph Story’s 1833 Commentaries on the Constitution of the US.

“That guy Roy Moore is way, way out there. He won’t even defend the rule of law,” said James Follett, 61, outside a Strange event at a Birmingham diner. “He wants to follow his judgment — not the judgment of the Supreme Court.”

The race also shows the potential weakness of the Republican establishment. McConnell marshaled the vast GOP war chest in Strange’s defense, and Trump and Vice President Mike Pence both campaigned with the candidate over the past week in Alabama. It wasn’t enough to carry Strange over Moore’s populist tidal wave, even in a state Trump won by 30 points.

Now McConnell and Trump will have to deal with the consequences. Observers of Capitol Hill have said Republicans should be terrified of Moore winning. “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.”

Moore — whom I profiled at length here — can make the body more conservative in a number of ways. He’ll likely shift the center of gravity in the caucus to the right, giving the existing right-wing hardliners — Sens. Rand Paul (KY), Ted Cruz (TX), and Mike Lee (UT) — an additional vote to pull the party in their direction.

“I can see him functioning as a quasi-Rand Paul, but perhaps more extreme,” added Allen Linken, a political scientist at the University of Alabama.