Conservative former judge Roy Moore easily defeated Alabama's incumbent Sen. Luther Strange on Tuesday in a Republican Senate primary runoff, marking the first time in five years that a sitting U.S. senator has lost a primary.

Moore won all but four of the state's 67 counties, getting 55 percent of the vote to 45 percent for Strange, who was backed by President Donald Trump.

Moore's victory delivered a major blow to the establishment wing of the national Republican party and to Senate Majority Leader Mitch McConnell, R-Ky., whose allied super PAC spent millions backing Strange's candidacy.

Trump campaigned for Strange, holding a rally in the state on Friday, as did Vice President Mike Pence. But a number of Trump's current and former aides endorsed the controversial Moore, including former White House strategist Steve Bannon and Secretary of Housing and Urban Development Ben Carson.

In his victory speech, Moore pledged to help Trump fulfill his 2016 campaign slogan to "make America great again," and told the crowd multiple times how strongly he supports Trump, even though Trump did not support his campaign.

Moore, long known for his religious zeal, also pledged to "return the knowledge of God" to the Constitution, saying "the separation of church and state doesn't separate us from God."

Following news of his victory, Republicans were quick to rally around Moore, starting with Trump himself. The president tweeted congratulations to Moore shortly after the race was called, and later on the two men spoke by phone, where Trump again congratulated Moore.

Trump tweet

Trump also appears to have tried to erase evidence of his support for the losing candidate. Late Tuesday, Trump deleted a series of tweets he had posted earlier in the day, urging voters to turn out for Strange.

Even Strange's biggest supporter in Washington, McConnell, publicly congratulated Moore, a candidate who missed few opportunities to criticize the Kentucky senator.

Moore "ran a spirited campaign centered around a dissatisfaction with the progress made in Washington," McConnell said in a statement. "Senate Republicans will be as committed to keeping Alabama's Senate seat in Republican hands with Roy Moore as we were with Luther Strange."

Moore will now face Democratic nominee Doug Jones in a Dec. 12 general election to fill the seat vacated by now Attorney General Jeff Sessions. Republicans hold every statewide elected office in Alabama and enjoy large majorities in both chambers of the legislature.

Judge Roy Moore: Great to talk with President Trump tonight about #ALSen! I very much look forward to working with the President to win in December!

By winning the GOP primary, Moore immediately becomes the favored candidate in December's general election.

Moore's victory on Tuesday also has national political implications. A fringe conservative who promises to fight the spread of "Sharia law," and bring Christianity to Washington, Moore campaigned on an anti-McConnell platform. He portrayed Strange as a rubber stamp for the GOP Senate majority leader.

If, as expected, Moore is elected to the Senate, McConnell will lose a reliable Republican vote within his caucus, and face a Senate colleague with a mandate to work against the GOP leadership agenda.

This could make it even more difficult than it already is for Republicans to pass meaningful legislation, such as tax reform or an infrastructure bill.