Alabama on Thursday certified the result of Doug Jones’s upset Senate victory, clearing the Democrat’s path to Washington just hours after his Republican rival filed a lawsuit asking for a new election.

Alabama Gov. Kay Ivey, Attorney General Steve Marshall and Secretary of State John Merrill — all Republicans — signed off on election results from all 67 counties and after late-counted provisional and military ballots were added to the total, Jones defeated Republican nominee Roy Moore by 21,924 votes out of more than 1.3 million cast.

Moore, the first Republican to lose a Senate race in Alabama since 1992, had attempted to stop that vote from being counted. Late Wednesday night, the former state judge filed a legal complaint alleging “election fraud,” and asked the state to consider holding a new election. But shortly before the official certification, Montgomery Circuit Judge Johnny Hardwick denied Moore’s request to stop the process.

In the complaint, filed in state court, Moore’s campaign argued that Alabama would “suffer irreparable harm if the election results are certified … without preserving and investigating all the evidence of potential fraud.”

Moore’s campaign cited rumors of election fraud that had already been investigated and refuted by the Alabama secretary of state, argued that high Democratic turnout in key areas was statistically unlikely, and reported that Moore himself had taken a polygraph test — an attempt to disprove allegations that he made unwanted sexual advances toward teenagers when he was in his 30s.

Moore’s lawyers filed the complaint at 10:33 Wednesday night and announced it to reporters less than two hours later. Early Thursday morning, Merrill’s office said that it would move ahead with the election certification unless ordered to do otherwise.

“This desperate attempt by Roy Moore to subvert the will of the people will not succeed,” said Jones transition spokesman Sam Coleman. “The election is over, it’s time to move on.”

At 12:26 p.m. Thursday, Hardwick dismissed Moore’s complaint, which contained little that election observers had not already investigated. Moore’s campaign argued that the election result, a 1.6-point margin of victory for Jones, was “contrary to most of the impartial, independent polls conducted prior to the Special Election.” In fact, the result was well within the margin of error across numerous polls; the tabulation of provisional and military ballots expanded Jones’s margin to 1.6 points.

The complaint went on to accuse the secretary of state of failing to properly investigate claims of “election fraud,” and suggested there were unanswered questions after sample ballots in one heavily Democratic county were found pre-marked for Jones. (Sample ballots are clearly marked and often in a different color than Election Day ballots.)

The complaint also recounts how the secretary of state investigated a viral video of a man saying people had come from “across the country” to help beat Moore — but goes on to argue that the investigation was not transparent. The man in the video turned out to be a legal Alabama voter.

“That was all fictitious,” Merrill said of the voter fraud complaint after certifying the election. “It was made up; it was just a lie that started on the Internet.”

Alabama Secretary of State John Merrill on Dec. 28 dismissed Republican Roy Moore's claims of voter fraud in the state's special Senate election. (Reuters)

The Moore campaign’s main argument was that high Democratic turnout and low support for Moore in the state’s most populous, urban counties resulted in an “implausible, unexplained 35 percent drop in votes for Roy Moore relative to the vote share of Republican Party straight-line votes.”

While Moore dramatically underperformed other Republican candidates in Alabama when he last ran for office, in 2012, the campaign cites four “experts” to argue that the state should “order a new special election to be held based upon the already known fraud which Secretary Merrill had acknowledged and taken action against and the further fraud alleged in this Complaint.”

The experts came to the case with baggage of their own. James Condit Jr., one of the election analysts who signed an affidavit on behalf of Moore’s campaign, has written and spoken about “Zionist” control of world politics, and alleged a Jewish role in the Sept. 11, 2001, terrorist attacks.

“The terror attacks of 9/11 were done by, in effect, Israeli agents,” Condit said in a 2016 radio broadcast. “These Israeli/Zionist/Jewish agents that are in on this crime syndicate — they did 9/11, covered it up with their five TV networks, which are run by the same crowd.”

Richard Charnin, who provided the court with an argument that there was just enough possible fraud to swing the election, claimed to have “mathematically” proved a conspiracy behind the assassination of John F. Kennedy. In 2016, Charnin alleged that mass election fraud had stolen key Democratic primaries from Sen. Bernie Sanders (I-Vt.), to the benefit of eventual nominee Hillary Clinton.

When Jones takes office in January, he will become Alabama’s first Democratic senator since 1997. An election-night vote count gave him a 20,715-vote margin over Moore, with 22,819 ballots cast for write-in candidates. Since then, provisional and military ballots were counted, expanding Jones’s lead, while county-by-county tabulations of the write-in vote found that Sen. Luther Strange (R-Ala.), who was appointed to the seat then defeated by Moore in the Republican primary, was the candidate most frequently chosen by protest voters.

After the election was certified, Jones said in a statement that he looks forward “to going to work for the people of Alabama in the new year.” Moore said in a statement that “this was a fraudulent election,” making no reference to Jones’s victory.

“I have stood for the truth about God and the Constitution for the people of Alabama,” said Moore. “I have no regrets. To God be the glory.”