Former Alabama Chief Justice Roy Moore won the Republican nomination for U.S. Senate on Tuesday, overcoming an incumbent with the strong backing of President Donald Trump and a major fundraising advantage.

With 95 percent of the vote in Tuesday night, Moore had 55 percent of the vote. Sen. Luther Strange, appointed to the seat in February, had 45 percent.

At a party at the RSA Activity Center in Montgomery Tuesday night, Moore thanked his supporters while hitting his traditional theme of bringing religion into the public square.

"Our duty is to serve Almighty God and acknowledge him in all things," the former chief justice – twice evicted from the bench for defying federal rulings on the Ten Commandments and same-sex marriage – told a cheering crowd.

More:Most GOP Senate voters say Trump was minor factor in their decisions

Moore’s victory highlighted the strength of his base of voters in the Alabama Republican Party; the lingering questions about Strange’s appointment by former Gov. Robert Bentley and the limits of Trump’s ability to influence elections.

The battle became a proxy war between national Republican factions both seeking Trump’s blessing but fighting over GOP congressional leadership’s ability to carry that out. Strange won Trump’s backing in early August, and the president tweeted several messages of support and – in the primary – recorded robocalls for the incumbent. Trump also appeared at a rally on behalf of Strange in Huntsville Friday and continued to promote his candidacy through Monday. Vice President Mike Pence appeared with Strange at a rally in Birmingham Monday.

Strange, a former Alabama attorney general, tried to make the race a referendum on Trump – still popular with Alabama Republicans – suggesting that his support from Trump meant Moore did not support the president.

More:Jones rallies for support from Democrats, black congressional lawmakers

But polls before the primary and the runoff showed the appearances having little effect on voters. Moore, with a loyal base, stuck to his traditional social conservative message, but also promised to carry out the Trump agenda and to oppose Senate Majority Leader Mitch McConnell, R-Ky., whose Senate Leadership Fund spent millions on ads attacking Moore. Moore drew in insurgent Republican support, including that of former Trump advisor Steve Bannon, engaged in a bitter fight with McConnell.

Bannon spoke before Moore at the victory party Tuesday night, trying to tie Moore to his own efforts to build an insurgent GOP movement.

"In state after state after state, people have followed the model of Judge Moore, that do not need to raise money from the elites, from the crony capitalists and the fat cats in Washington DC," Bannon said.

Strange in a concession statement thanked Trump for his support.

"From the beginning of this campaign, my priority has been serving the people of Alabama," the statement said. "Tomorrow I will go back to work with President Trump and do all I can to advance his agenda over the next few weeks."

SLF president Steven Law said in a statement it was "vital" to keep the seat in Republican hands.

"Senator Strange can hold his head high knowing that he played a critical role in cleaning up the corruption in Montgomery, confirming President Trump’s choice for the Supreme Court, and strongly supporting the President’s priorities on border security and repealing Obamacare," the statement said.

In the end, though, Alabama politics proved more decisive than the national struggles. Moore's devoted base, cultivated over 17 years, gave the judge overwhelmingly victories in the Wiregrass, his traditional stronghold, and throughout rural Alabama.

Strange needed solid victories in Alabama's urban and suburban counties. But outside Jefferson County, which the incumbent won easily, Strange underperformed around the state. He edged Moore in Madison County, where Trump held a rally Friday, but lost Montgomery 52 to 47 percent, and fell short in Mobile, losing 54 to 46 percent.

Moore won Autauga County with 63 percent of the vote, and took Elmore with 65 percent of the vote.

Bill Armistead, a former Alabama Republican Party chairman and Moore’s campaign chairman, said people in Alabama “know Roy Moore.”

“It’s very difficult to transfer one’s popularity to another candidate,” Armistead said. “Trump is very popular in Alabama, but you can’t say ‘because he’s popular, whoever he likes will be popular, too.’ It just doesn’t work that way.”

Whoever they supported, voters Tuesday mostly said that the Trump endorsement had little to no effect on their decision.

“It was a little disappointing,” said Jennifer Hunt, a graphic designer from Auburn who voted for Moore. “(But) it didn’t affect my decision.”

Strange also struggled with questions about his appointment by Bentley. Bentley resigned from office in April after pleading guilty to two campaign finance violations, following an investigation by the Alabama attorney general’s office. Strange interviewed for and accepted the Senate appointment while the investigation took place. He never said what role if any he had in the probe, and avoided questions about it on Thursday night.

Voters who spoke with the Advertiser Thursday tended to bring up the Bentley appointment more than the Trump endorsement. Senate President Pro Tem Del Marsh, R-Anniston, who flirted with a Senate run this spring, said Tuesday he warned national Republicans who backed Strange that that could happen.

"The original question, and I made this clear to Washington, is the people of Alabama did not like the way Luther Strange received his appointment from Bentley," Marsh said. "That was embedded in the minds of Alabamians."

Angi Horn Stalnaker, a Alabama Republican consultant who has run races against Moore, was blunt.

"D.C. political consultants have a place in politics, but tonight's election proves that place is not south of the Mason Dixon," she wrote.

Moore faces former U.S. Attorney Doug Jones, the Democratic nominee for the seat, in the general election on Dec. 12. In a statement, Jones said he was focusing on "the issues that matter to the people of Alabama -- health care, jobs and the economy."

"After years of embarrassing headlines about top public officials in this state, this race is about the people of Alabama and about choosing a candidate with character and integrity they can be proud of," the statement said. "I will never embarrass the people of Alabama. I am running so the people of Alabama can be proud of their next senator."