An extremist Republican accused of molesting teens lost the Senate election in Alabama, buoying the Democratic Party and delivering President Donald Trump a stinging blow that endangers his agenda.
Roy Moore lost on Tuesday to Democrat Doug Jones by about 1.5 per cent in the traditionally staunch Republican state where Trump had won by a margin of 27 percent.
The Democratic victory that followed party's wins last month in governors' races in Virginia and New Jersey, as well in several other contests across the nation, is a morale booster for the party reeling from Hillary Clinton's loss to Trump a year ago.
"We have shown the country the way that we can be unified," declared a triumphant Jones, who carried the votes of minorities and women in a year of political polarisation.
The Republican defeat set the stage for soul-searching within the party of its strategies and politics and of the divisive style of Trump himself.
Moore, a former state chief justice with conservative Christian religious pretensions, has been accused by nine women of molesting or assaulting them, one of them while she was 14 and another when she was 16. Most of the allegations are from the 1970s.
The allegations came as the nation is in the throes of dealing with sexual misconduct by men in power, whether in politics or in the media and entertainment. Two Democrats, Senator Al Franken and Representative John Conyers, who was the longest serving Congressman, have resigned in recent days after being accused of sexual misconduct.
The allegations against Moore, especially those involving young girls, split the Republican Party, with several leaders demanding that he withdraw from the race. They included House of Representatives Speaker Paul Ryan, the other Alabama Senator Richard Shelby and 13 other senators.
Some of the leaders suggested having a write-in candidate for the party. Although it was not formally organised, there were 1.7 per cent write in votes that cost him the election.
Trump uncharacteristically conceded defeat and reached out to Jones. "Congratulations to Doug Jones on a hard fought victory," he tweeted minutes after the results became known.
"The write-in votes played a very big factor, but a win is a win," he added. "The people of Alabama are great."
The vacancy arose when Jeff Sessions resigned the seat to become the Attorney General, confident his party would hold it.
Trump had himself opposed Moore in the primary election in which party members selected the candidate for the main election. But the candidate backed by Trump, Luther Strange, who was appointed to temporarily fill the Senate vacancy, lost the primary in an early blow to the president.
After initial hesitations, Trump endorsed Moore but did not visit the state to actively campaign for him.
Moore's candidacy exposed wide fissures in the Republican Party between an extremist wing represented by Trump's former strategist Stephen Bannon who was behind Moore's candidacy, and the others, including Trump.
The defeat is a blow to Bannon and his brand of politics which is more extreme than Trump's, but was spawned by Trump's own populism. The party and Trump are sure to re-evaluate strategies ahead of next year's elections when 33 senators will be up for election, eight of them Republicans.
The Republican Party's majority in the 100-member Senate is now trimmed to 51, putting Trump's radical agenda at risk - he could not find enough support among his party's senators to repeal the universal health insurance programme of former President Barack Obama and only after several compromises was he able to muster the majority to pass his tax reform bill.