Democrat Doug Jones was officially declared the winner of the US Senate race in the southern state of Alabama on Thursday, whittling down the slim Republican majority in the chamber.
Alabama Secretary of State John Merrill certified the results of the December 12 special election and dismissed claims of voter fraud by the campaign of the defeated Republican candidate, Roy Moore.
With Mr Jones' upset victory in a Republican bastion, the party of President Donald Trump now holds 51 seats in the Senate and the Democrats 49 - the slimmest of majorities.
The Alabama result dealt a stinging blow to Mr Trump, who had thrown his support behind Mr Moore, a conservative Christian.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Mr Moore appeared to be the favorite in the contest being held to fill the Senate seat held by Jeff Sessions, whom Mr Trump had named attorney general.
And Mr Trump had easily captured the state in last year's presidential election.
But Mr Moore's campaign was rocked in the final days of the race by allegations the former judge had engaged in sexual misconduct decades ago, including molesting a teenage girl.
Mr Moore - a former chief justice of the Alabama Supreme Court - has refused to concede and even launched a last-minute legal challenge of the results, but a judge dismissed his suit, which called for certification of the results to be delayed.
Mr Jones won 49.97 per cent of the vote compared to Mr Moore's 48.34 per cent, a margin of nearly 22,000 votes out of 1.35 million cast - a record for a special election.
Alleged 'irregularities'
Late Wednesday, Mr Moore's campaign called for the certification of the results to be postponed pending a "thorough investigation of potential election fraud".
The suit filed by Mr Moore's campaign cited "irregularities" in 20 precincts in Jefferson County, which it said were "enough to reverse the outcome of the election".
To back up the claims, Mr Moore's team cited mathematician Richard Charnin, a conspiracy theorist who also asserts the 2004 presidential election and 2016 Democratic presidential primary were rigged.
The complaint also contained an affidavit from Mr Moore "stating that he successfully completed a polygraph test confirming the representations of misconduct made against him during the campaign are completely false".
Montgomery County Circuit Judge Johnny Hardwick however dismissed the complaint.
Mr Moore, who has suggested the 9/11 attacks may have happened because of a lack of faith in God and argued Muslims should be barred from holding office, had wanted to bring his fiery brand of Christian religious activism to Washington.
He was set to cruise to victory until allegations by several women - first reported by The Washington Post - that he assaulted, molested or pursued them when they were teenagers, including sexually touching one who was 14 years old at the time.
At the time, Mr Moore was in his early 30s and working as an assistant district attorney.
Mr Moore, 70, served twice as chief justice of the Alabama Supreme Court but was relieved of his duties on both occasions.
The first time was in 2003 for refusing a judge's order to remove a granite monument of the 10 Commandments from the state supreme court building.
The second time was in 2016 for refusing to accept the US Supreme Court's ruling authorising gay marriage.

