Defeated Senate candidate Roy Moore released a video statement Wednesday night, refusing to concede — even as President Trump and GOP leadership have acknowledged the shocking Alabama upset.

Moore struck a defiant tone in his 4-minute, 46-second YouTube speech, insisting the race — and the “struggle to preserve our republic” — isn’t over.

“We are indeed in a struggle to preserve our republic, our civilization and our religion and to set free a suffering humanity — and the battle rages on,” Moore said, seated behind a table and wearing a Christian cross lapel pin on his sportcoat.

“In this race, we have not received the final count to include military and provisional ballots. This has been a very close race and we are awaiting certification by the secretary of state.”

With all precincts reporting, Democrat Doug Jones led Moore by 49.9 percent to 48.4 percent — a gap of more than 20,000 votes.

Alabama’s secretary of state said there’s no realistic expectation that uncounted ballots could close that gap, or even bring it to within half a percentage point — the state’s standard for an automatic recount.

With the win, Jones became this century’s first Democrat elected to the Senate from Alabama.

Moore was dogged by allegations that he pursed relationships with teenage girls when he was in his 30s.

Moore said he’ll keep fighting for the Senate seat, saying he wants to help Trump restore traditional values. Trump has already congratulated Jones on the win.

“After the election of Donald Trump a little over a year ago, I saw a window of hope and an opportunity that we could return to our founding principles,” said Moore, who also decried homosexuals, transsexuals, marriage equality, abortion rights and bans against public-school prayer.