In a nail-biter of a Senate special election in Alabama on Tuesday, Democrat Doug Jones beat Republican opponent Roy Moore by about 20,000 votes in a surprise victory — but Moore has refused to concede defeat.

“When the vote is this close, it’s not over, and we still got to go by the rules,” Moore told supporters at his election rally Tuesday night as officials said 99 percent of the vote had been counted.

Moore said that he will seek a recount.

“Part of the problem with this campaign is that we’ve been painted in an unfavorable and unfaithful light. We’ve been put in a hole,” said the former judge, later adding: “What we’ve got to do [is] wait on God and let this process play out.”

Moore, 70, has been accused by several women of sexual misconduct, including one who claimed Moore molested her when she was 14 years old and he was in his 30s.

Jones’ campaign team confirmed that Moore had not called to concede defeat, according to MSNBC producer David Ingram.

Senior Jones campaign official confirms Roy Moore never called to concede the race. — David Ingram (@davidhastweets) December 13, 2017

“Let’s go home and sleep on it, and we’ll take it on tomorrow,” Moore, who was endorsed by President Donald Trump, told his supporters before walking off the stage.

Alabama Secretary of State John Merrill reported Jones with 49.92 percent of the vote and Moore with 48.38 percent with all counties reporting. That’s a difference of about 1.5 percentage points.

An automatic recount is triggered under state law only when a race is within half a percentage point. Merrill told CNN that either candidate could still call for a recount, but they’d have to cover the cost. (He did not immediately respond Thursday to a request for comment regarding whether that section of the law does in fact apply to Senate races.)

Still, Merrill stressed to CNN that even with a recount, it’s “highly unlikely” that the outcome would change.

“There’s not a whole lot of mistakes that are made,” Merrill said.

Jones, a former attorney, is the first Democrat to win a Senate seat in Alabama in 25 years.

This story has been updated to note a dispute about Alabama’s recount law.