Roy Moore defeated Alabama Sen. Luther Strange in Tuesday’s Alabama Republican Senate primary runoff.

With 82 percent of precincts reporting, Moore received 55.8 percent of the vote, while Strange received 44.2 percent, according to The New York Times.

The primary took on national importance as President Trump endorsed Strange, while traditional Trump allies, such as former White House chief strategist Steve Bannon, backed Moore.

“They’re going to say, ‘Donald Trump, the President of the United States, was unable to pull his candidate across the line. It is a terrible, terrible moment for Trump,'” the president said while imitating news anchors at a Friday rally in Alabama in support of Strange.

Strange become a senator when Jeff Sessions left his seat to become attorney general. The senator is a former lobbyist and was backed by a super PAC linked to Majority Leader Mitch McConnell, and the Chamber of Commerce, a typical establishment GOP partner.

“Mitch McConnell and this permanent political class is the most corrupt and incompetent group of individuals in this country. They think you’re a pack of morons. They think you’re nothing but rubes,” Bannon said at a rally Monday in support of Moore. “They have no interest at all in what you have to say, what you have to think or what you want to do.”

However, Trump contended at his Friday rally in support of Strange that the senator barely knew McConnell, and that Strange is “determined to drain that swamp.”

The president would go on to say, “I’ll be honest, I might have made a mistake,” and said he would campaign “like hell” for Moore if he were to win the primary. The former Alabama Supreme Court chief justice led the race throughout in the polls, and was up by 11 points in the final public poll.

Moore is a major figure in Alabama and became nationally known in 2003 when he was removed from office after defying a federal court’s ruling to remove a Ten Commandments monument from the Alabama state Supreme Court building.

Like Trump, the former judge has a brash, and sometimes offensive manner of speaking.

“Now we have blacks and whites fighting, reds and yellows fighting, Democrats and Republicans fighting, men and women fighting. What’s going to unite us? What’s going to bring us back together? A president? A Congress? No. It’s going to be God,” Moore said in a campaign speech.

Moore also presented himself as an anti-establishment, anti-free trade, and anti-immigration candidate, even though he didn’t know what the Deferred Action for Childhood Arrivals (DACA) amnesty program was in a radio interview.

Trump chose to back Strange over Moore and Rep. Mo Brooks in early August before the runoff election. Steve Bannon privately blamed presidential son-in-law and senior adviser Jared Kushner for the endorsement, according to a Republican Alabama political operative.

A White House official, however, denied that Kushner ever discussed an endorsement with the president.

Moore’s victory nonetheless is already being spun as being a positive for Trump.

“Judge Moore is an American hero who will be a tremendous asset to the President in the Senate. So tonight is actually a yuge victory for President Trump,” Sam Nunberg, a former Trump campaign aide, told The Daily Caller.

The general election for the Alabama Senate race is on December 12 and Moore will face-off against Democrat Doug Jones. Alabama has not elected a Democrat to the Senate since 1992.