After congratulating Doug Jones for his victory in the Alabama Senate race Tuesday, President Trump said he knew Roy Moore would never be able to win in the general election.

“I was right!” Trump tweeted early Wednesday morning. “Roy worked hard but the deck was stacked against him!”

Trump said he originally endorsed Moore’s primary opponent Luther Strange because he knew Moore would falter in the general election.

The reason I originally endorsed Luther Strange (and his numbers went up mightily), is that I said Roy Moore will not be able to win the General Election. I was right! Roy worked hard but the deck was stacked against him! — Donald J. Trump (@realDonaldTrump) December 13, 2017

Advertisement

Following the election Tuesday night, Trump tweeted congratulations to Jones, who defeated Moore for the US Senate seat by a tight margin in Tuesday’s special election. Moore refused to concede Tuesday night, but has not yet called for a recount.

Get Today in Politics in your inbox: A digest of the top political stories from the Globe, sent to your inbox Monday-Friday. Sign Up Thank you for signing up! Sign up for more newsletters here

“The write-in votes played a very big factor, but a win is a win,” Trump tweeted. “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!”

Congratulations to Doug Jones on a hard fought victory. The write-in votes played a very big factor, but 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! — Donald J. Trump (@realDonaldTrump) December 13, 2017

The tweet was a stark turnaround from Trump’s harsh criticism of Jones in recent weeks. The president had supported Moore, who long led the race despite facing multiple allegations of sexual misconduct.

Earlier on Tuesday, Trump called Jones a “Pelosi/Schumer Puppet” and said Alabama “will do the right thing” by voting for Moore.

The people of Alabama will do the right thing. Doug Jones is Pro-Abortion, weak on Crime, Military and Illegal Immigration, Bad for Gun Owners and Veterans and against the WALL. Jones is a Pelosi/Schumer Puppet. Roy Moore will always vote with us. VOTE ROY MOORE! — Donald J. Trump (@realDonaldTrump) December 12, 2017

Over the course of the past week, Trump has tweeted about the campaign several times, often calling Jones a “puppet” and stating that he would vote against Republicans.

Advertisement

“LAST thing the Make America Great Again Agenda needs is a Liberal Democrat in Senate where we have so little margin for victory already,” Trump tweeted on Friday. “The Pelosi/Schumer Puppet Jones would vote against us 100% of the time.”

LAST thing the Make America Great Again Agenda needs is a Liberal Democrat in Senate where we have so little margin for victory already. The Pelosi/Schumer Puppet Jones would vote against us 100% of the time. He?s bad on Crime, Life, Border, Vets, Guns & Military. VOTE ROY MOORE! — Donald J. Trump (@realDonaldTrump) December 8, 2017

“Jones will always vote against what we must do for our Country,” he tweeted the next day.

A big contingent of very enthusiastic Roy Moore fans at the rally last night. We can?t have a Pelosi/Schumer Liberal Democrat, Jones, in that important Alabama Senate seat. Need your vote to Make America Great Again! Jones will always vote against what we must do for our Country. — Donald J. Trump (@realDonaldTrump) December 9, 2017

Felicia Gans can be reached at felicia.gans@globe.com . Follow her on Twitter @FeliciaGans