Julian Castro, secretary of Housing and Urban Development under former President Obama, issued a warning to Sen. Ted Cruz (R-Texas) after Democratic candidate Doug Jones won the Alabama Senate race Tuesday.

"Be afraid, @tedcruz . Be very afraid," Castro tweeted.

Jones's stunning victory over Republican opponent Roy Moore comes after a closely watched campaign to fill the seat vacated by Attorney General Jeff Sessions.

Moore was accused of sexual misconduct last month by multiple women, including one woman who said Moore initiated a sexual encounter with her when she was 14 years old and he was in his 30s.

Moore denied the allegations, but faced calls to drop out of the race from top Republicans.

President Trump threw his support behind Moore, however, urging his followers on Twitter to vote for Moore and holding a campaign rally near the Alabama border in support of Moore.

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

His victory tightens Republicans' margin in the Senate, giving them just a 51-49 advantage over Democrats heading into the 2018 midterm elections.

Cruz is facing a challenge from Rep. Beto O'Rourke (D-Texas) in 2018. O'Rourke has raised nearly $2.8 million since he jumped into the race, according to reports filed with the Federal Election Commission.