President Donald Trump congratulated Democrat Senate candidate Doug Jones after he defeated Republican Roy Moore in the special election in the state of Alabama.

“Congratulations to Doug Jones on a hard fought victory,” Trump wrote on Twitter. “The write-in votes played a very big factor, but a win is a win.”

The president thanked the people of Alabama, urging them on to the next election.

“The people of Alabama are great, and the Republicans will have another shot at this seat in a very short period of time,” he said. “It never ends!”

Trump didn’t physically campaign for Moore, but he did record a robocall on his behalf and urged Republicans on Twitter to “do the right thing” and vote for the Republican candidate. He stood by Moore, despite the establishment GOP rejecting him after the Washington Post bombshell report about Moore’s pursuit of high-school-aged girls in his 30s that disrupted the campaign.