WASHINGTON — In a stunning upset, Roy Moore, the controversial Republican nominee backed by President Donald Trump in a Senate race in Alabama, was projected to lose against his Democratic challenger.

Networks called the race late Tuesday night for Doug Jones, a former prosecutor. He was ahead by just over 1 percent of the vote at 10:30 p.m. Jones would be the first Democrat elected to the Senate from Alabama since 1992.

Moore, a former state chief justice twice removed for ignoring U.S. Supreme Court rulings on church-state separation and on gay marriage, had been beset by allegations that when he was in his 30s he wooed teenage girls. Two women accused him of sexual assault.

Moore drew criticism from some Jewish quarters in the last week for suggesting that billionaire liberal philanthropist George Soros was headed to hell and that his agenda was “not our America culture.” That was compounded by his wife Kayla Moore at his final rally on Monday night, when in defending the couple’s record on Jews, she told the crowd, “One of our attorneys is a Jew.”

In an acceptance speech at 11 p.m, Jones acknowledged his Jewish supporters.

“To all my Jewish friends, Happy Chanukah,” he said.

Trump had endorsed Moore’s primary challenger, Luther Strange, but pivoted to Moore after he soundly defeated Strange in the September primary. The president went all in for Moore in the campaign’s final days, recording a robocall endorsement for the candidate and turning a rally he headlined in Pensacola, Florida, near the Alabama border, into a Moore election event.

Establishment Republican leaders had distanced themselves from Moore, but Trump heeded Moore’s most prominent backer, Steve Bannon, the CEO of Breitbart News. Bannon, who was a top White House adviser to Trump until August, had urged the president to back Moore.