Democrat Doug Jones won a bitter fight for a US Senate seat in deeply conservative Alabama, dealing a political blow to President Donald Trump in a race marked by sexual misconduct accusations against Republican candidate Roy Moore.

The stunning upset by Jones makes him the first Democrat elected to the US Senate from Alabama in a quarter-century and will trim the Republicans' already narrow Senate majority to 51-49, endangering Trump's agenda and opening the door for Democrats to possibly retake the chamber in next year's congressional elections.

With 99 percent of the vote counted, Jones had a 1.5 percentage-point lead over Moore. But the Republican refused to concede, telling supporters in Montgomery that votes were still coming in and state law would trigger a recount if the margin was within half a percent.

In a CNN interview, Alabama Secretary of State John Merrill said it was "highly unlikely" that anything would change the election outcome. "The people of Alabama have spoken," he said.

The ugly campaign drew national attention and split the Republican Party over accusations from several women that Moore pursued them when they were teens and he was in his 30s.

Moore, 70, a Christian conservative who was removed from the state Supreme Court in Alabama twice for ignoring federal law, denied the allegations and said he did not know any of the women who made them. Reuters has not independently verified the allegations.

Trump endorsed Moore even as other party leaders in Washington walked away from him, but Jones, 63, a former federal prosecutor, portrayed the campaign as a referendum on decency and promised the state's voters he would not embarrass them in Washington.

"I have always believed that the people of Alabama have more in common than divides us," Jones told cheering supporters at his Birmingham victory party, where Lynyrd Skynyrd's "Sweet Home Alabama" had earlier blasted from the speakers.

"We have shown the country the way we can be unified," said Jones, who as a U.S. attorney prosecuted members of the Ku Klux Klan for a 1963 bombing of a Birmingham church that killed four little girls.

Jones, who cast himself on the campaign trail as the candidate who could reach across the aisle and get things done in Washington, said Alabama had often taken the wrong road when it came to a crossroads.

"Tonight you took the right road," Jones said.

Jones is expected to take office early in January, after the results are certified. His election will not effect the pending votes in Congress on a tax overhaul or government funding.

TRUMP CONGRATULATES JONES

Senate Republican leader Mitch McConnell had called on Moore to drop out of the race and other Senate leaders had suggested he should eventually be expelled from the Senate if elected.

"Decency wins," tweeted retiring Republican Senator Jeff Flake, a frequent critic of Trump.

The sexual misconduct allegations against Moore came at a time that many powerful men, including Trump, have faced similar accusations. Democrats had promised to try to link many Republican candidates in next year's elections to Moore, and use the issue to appeal to women and suburban voters.

The network exit polls found 54 percent of voters said the sexual allegations against Moore were not important to their vote, while 41 percent said they were.

"Part of the problem with this campaign is we've been painted in an unfavorable light," Moore told supporters in Montgomery who sang Christian hymns while they waited for Moore to speak.

Trump had recorded robo-calls to voters to bolster turnout for Moore, and held a campaign rally across the border in Florida last week. Trump's former senior adviser, Steve Bannon, appeared at two rallies with Moore down the stretch.

Trump tweeted his congratulations to Jones and said that "a win is a win. The people of Alabama are great, and the Republicans will have another shot at this seat in a very short period of time. It never ends!"

Network exit polls, however, showed Trump was not a factor in the decision for about half of Alabama voters. A further 29 percent said they voted to express support for Trump, and 20 percent said they voted to oppose him.

John Laine, 65, a retired book editor from Birmingham who backed Jones, said he thought many Republicans crossed over and voted for a Democrat "maybe for the first time in the lives. My cousin said she had to hold her nose and vote Democrat."

"The reason is that people just couldn't stomach any more of Roy Moore," Laine said.

Former Democratic President Barack Obama recorded robo-calls for Jones to help turn out African-American voters, who network exit polls said constituted about 30 percent of the electorate on Tuesday.

Jones also supported abortion rights and opposed the repeal of Obama's signature healthcare law, unpopular positions in the conservative state. Moore and Trump labeled Jones a liberal follower of Democratic House of Representatives leader Nancy Pelosi. 

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.