President Donald Trump’s pick in Alabama’s Senate special election may have been defeated, but the president claims it’s still a victory for him.

Trump on Wednesday morning said that Republican candidate Roy Moore’s loss was proof that “I was right” that Moore couldn’t win. Trump backed incumbent Sen. Luther Strange (R) in the GOP primary, which Moore won.

The president also claimed “the deck was stacked” against Moore, who lost a seat held by Republicans for more than two decades after weeks of battling sexual misconduct allegations. The accusations, first reported by The Washington Post, didn’t come out until weeks after the Republican primary.

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

If last night’s election proved anything, it proved that we need to put up GREAT Republican candidates to increase the razor thin margins in both the House and Senate. — Donald J. Trump (@realDonaldTrump) December 13, 2017

Trump on Tuesday night congratulated Democrat Doug Jones on a “hard fought victory.” But Moore later refused to concede and said he planned to demand a recount.

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

Trump endorsed Moore earlier this month in spite of a mounting list of sexual harassment and assault allegations against the candidate, including child molestation.

Trump never physically campaigned with Moore, but did record a robocall in the campaign’s final days and tweet pro-Moore and anti-Jones messaging on several occasions.