(Getty)

Roy Moore, the most homophobic Senate candidate in recent history, has lost his election.

The Republican candidate for Alabama’s US Senate seat, who has said that “homosexual conduct” should be illegal, lost to Democrat Doug Jones by 49.9% to 48.4%, or 20,000 votes.

Moore has been accused of committing sexual misconduct and child molestation against nine victims, including a 14-year-old.

He has not yet conceded the election to Jones, but the Democratic Senator-elect’s margin of victory – with all of the votes counted – is three times as large as the gap which would be required to trigger a recount.

The result leaves the Senate with 51 Republicans and 49 Democrats, a potentially significant shift which leaves moderate or dissenting Republicans like Susan Collins, Lisa Murkowski and Bob Corker with more power.

Before the sexual assault allegations – for which Moore blamed LGBT people – began streaming in a month ago, the disgraced former judge had already made a series of virulently homophobic comments.

Moore said he “doesn’t know” if gay people should be executed.

He also compared gay sex to bestiality and said that decriminalising homosexuality was “terrible” and “devastating”.

At the same event, Moore said that the legalisation of same-sex marriage would lead to laws allowing “one man to marry ten women or a man to marry his two daughters.”

The 70-year-old compared those who follow same-sex marriage laws to Nazis.

Despite these horrifically homophobic comments, Republicans flooded to support Moore – including President Donald Trump.

Trump, who continued to campaign enthusiastically for Moore up to last night, now faces having backed two losing candidates in the same special election, after backing Luther Stranger in the Republican primary.

After a period of hedging following the claims of sexual misconduct, the President threw his support behind Moore.

Most of the women who Moore allegedly sexually assaulted were teenagers at the time.

Leigh Corfman was 14 when Moore, a 32-year-old assistant district attorney, allegedly stripped the child and touched her over her bra and underpants.

Enticing a child under 16 to enter a home with the purpose of proposing sexual intercourse or fondling of sexual and genital parts is – and was – a felony which means up to 10 years in prison.

He was allegedly banned from his local mall in Alabama because of his behaviour towards teenage girls there.

Moore resisted calls from more than a dozen Republican senators – including Majority Leader of the Senate Mitch McConnell – to step aside.

Reacting to the result last night, Moore told his supporters: “You know, part of the thing — part of the problem with this campaign is we’ve been painted in an unfavourable and unfaithful light.

“We’ve been put in a hole, if you will.”

Jones, who became the first Democratic Alabama Senator in two decades, started his victory speech by saying: “I think that I have been waiting all my life and now I just don’t know what the hell to say.”

He added: “This entire race has been about dignity and respect.

“This campaign has been about the rule of law.

“This campaign has been about common courtesy and decency and making sure everyone in this state, regardless of what zip code you live in, is going to get a fair shake.”

Jones continued: “I have always believed that the people of Alabama have more in common than divides us.

“We have shown the country the way that we can be.”

At the bottom of his victory tweet, he included the hashtag “#RightSideOfHistory”.

And that just about sums it up.