Democrat Doug Jones pulled off a stunning victory on Tuesday, 12 December, in Alabama after defeating Republican rival Roy Moore in the race for a Senate seat, dealing a sharp political blow to US President Donald Trump. And Twitter immediately erupted with joy over the news, saying "decency won" in the key race.

Jones is the first Democrat to win a Senate seat in Alabama since 1992.

Trump threw his support behind the embattled Moore despite backlash over the series of sexual allegations against the former judge. Earlier, number of women had accused Moore of sexually harassing or assaulting them when he was in his 30s. One of the women had also said Moore made unwanted advances towards her when she was just 14 years old.

The president took to Twitter late on Tuesday to congratulate Jones on his "hard-fought victory".

"Congratulations to Doug Jones on a hard-fought victory," Trump tweeted. "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!"

He later tweeted, "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!"

Jones' momentous victory will also trim the Republican majority over Democrats in the Senate to 51-49.

Meanwhile, Twitter burst with celebration, excitement and hope over the news, with many using the viral hashtag #ThankYouAlabama.

Hillary Clinton tweeted, "Tonight, Alabama voters elected a senator who'll make them proud. And if Democrats can win in Alabama, we can – and must – compete everywhere. Onward!"

Former vice president Joe Biden wrote, "Doug Jones. Thank you, Alabama. You've elected a man of incredible integrity, grit and character. A fighter for working class and middle class Alabamians. He is going to make you proud in the Senate."

doug jones
Doug Jones defeated his Republican challenger Roy Moore to claim Alabama's US Senate seat that was vacated by Attorney General Jeff Sessions Justin Sullivan/Getty Images