President Trump Donald John TrumpOmar fires back at Trump over rally remarks: 'This is my country' Pelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Trump mocks Biden appearance, mask use ahead of first debate MORE in an early morning tweet on Wednesday said he endorsed Sen. Luther Strange Luther Johnson StrangeSessions hits back at Trump days ahead of Alabama Senate runoff The biggest political upsets of the decade State 'certificate of need' laws need to go MORE in the Alabama Senate Republican primary because Roy Moore would not be able to win 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,” the president said.

“I was right!” he added. “Roy worked hard but the deck was stacked against him!”

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

The tweet came hours after Democrat Doug Jones defeated Moore, who was the target of multiple sexual misconduct allegations, in the Alabama Senate special election. It is the first time in a quarter century that Alabama will send a Democrat to the Senate.

Multiple Republicans urged Moore to drop out of the race, but Trump endorsed him despite the allegations. Trump also recorded a robocall for the former judge, ripped Jones on Twitter and urged supporters at a campaign rally last week to “get out and vote for Roy Moore.”

The president late Tuesday congratulated Jones on a “hard fought victory.”

“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

Establishment Republicans had pushed back on Moore's campaign, given his controversial views and the numerous allegations of sexual misconduct against him.

Senate Majority Leader Mitch McConnell Addison (Mitch) Mitchell McConnellPelosi: Trump hurrying to fill SCOTUS seat so he can repeal ObamaCare Senate GOP aims to confirm Trump court pick by Oct. 29: report Trump argues full Supreme Court needed to settle potential election disputes MORE (R-Ky.) and his allies looked to portray Moore as an unelectable candidate who only appealed to grass-roots conservatives.

Various Republicans, including Alabama Sen. Richard Shelby Richard Craig ShelbySenate GOP eyes early exit Dems discussing government funding bill into February GOP short of votes on Trump's controversial Fed pick MORE, also worked to persuade voters in the state to write in candidates as a means of opposing Moore.

Jones defeated Moore by 1.5 percentage points, while more than 1.7 percent of the electorate chose to write in a candidate instead of voting for Jones or Moore.

Moore's defeat, which is expected to put control of the Senate in play in 2018, marks the biggest political defeat for the Trump administration so far.

And despite Trump's claim that his endorsement helped boost Strange “mightily,” a poll released one day before the primary runoff in September showed Moore leading Strange by 11 points. The survey was conducted after Trump appeared at a rally to campaign alongside Strange, who had been cast as the Washington establishment candidate in the race.

In that poll, 31 percent said Trump's backing would make them vote for Strange, while 29.5 percent said it would make them vote for Moore. More than one-third, 37 percent, said the endorsement had no effect on them.

Julia Manchester contributed to this report, which was updated at 7:54 a.m.