Ultra-conservative former Judge Roy Moore dealt a blow to establishment GOP leaders Tuesday with a runaway victory over incumbent US Sen. Luther Strange in a special GOP primary election in Alabama.

With 100 percent of precincts reporting, the tally was 54.6 percent for Moore and 45.4 percent for Strange, who had been appointed to the seat long held by Jeff Sessions and who had been backed by President Trump.

“I will fight for the people of this state and of this nation who want to bring our country back to its greatness,” declared Moore, a firebrand who had twice been removed from the bench for defying federal court orders on same-sex marriage and the courthouse display of a Ten Commandments monument.

His win came at the expense of Trump, who campaigned for Strange but also said he would support Moore if the ex-judge won.

“Congratulations to Roy Moore on his Republican Primary win in Alabama. Luther Strange started way back & ran a good race,” Trump tweeted about an hour after Moore was declared the winner.

“Roy, WIN in Dec!”

The drubbing of Strange was also a hit to Senate Majority Leader Mitch McConnell (R-Ky.) and GOP leaders who ran ads against Moore and strongly backed Strange.

Moore, meanwhile, was cast as the anti-establishment candidate backed by Trump’s former chief strategist, Steve Bannon.

“Who is sovereign, the people or the money? Alabama answered today, the people,” a jubilant Bannon said Tuesday night.

Friday night, Trump spoke at a rally for Strange — at which his comments denouncing NFL players kneeling during the national anthem made the biggest headlines.

Strange thanked Trump, saying the president might face fire for backing him, “but that’s what friends do.”

Strange was appointed by then-Gov. Robert Bentley to the seat after Sessions became Trump’s attorney general.

The appointment of Strange, then the state’s attorney general who was investigating the governor, came under scrutiny when Bentley resigned months later amid allegations that he had used taxpayer money to cover up an affair with a top aide.

Moore will face Democrat Doug Jones, a former Alabama US attorney, on Dec. 12.

“We wish [Moore] well going forward,” Strange said.

“We’re dealing with a political environment that I’ve never had an experience with.”

Strrange said he has no regrets.

“I’m not going to lose sleep tonight,” he said. “We did the right thing. We did it the right way.”