WASHINGTON -- There were plenty of reasons why Republican Roy Moore's defeat in the scandal-plagued Alabama election was a blessing for the GOP, despite losing a seat in a closely divided Senate.
First and foremost was the political nightmare his party faced from a Select Committee on Ethics investigation into the multiple sexual misconduct allegations that would have dragged on for months, followed, most likely, by a move to expel him from the Senate.
The Senate Ethics Manual states that the Senate has the authority to review improper conduct "so notorious or reprehensible that it could discredit the institution as a whole, not just the individual, thereby invoking the Senate's inherent and constitutional right to protect its own integrity and reputation."
If Moore had won Tuesday, his fellow senators would have "the discretionary authority and power to commence ethics proceedings against him as soon as he takes his seat among them," wrote Robert L. Walker, an attorney and a former chief counsel and staff director of the Senate and House ethics committees, in a Washington Post op-ed column earlier this week.
Nothing would have been more politically distasteful and harmful in the 2018 midterm election season, when Republican control of the Senate will be on the line.
As the political map looks now, Republican control of the Senate seems likely next year, but it's not a sure thing.
Ten Democratic seats are up for re-election in states that Trump carried last year, and just two GOP seats are said to be toss-ups.
Moore has yet to concede defeat, saying that the slim margin of Democrat Doug Jones' victory could result in an automatic recount. If Tuesday's results hold, the GOP will have a tenuous 51-to-49 seat majority.
From the start of the alarming sex scandal broken by the Post, involving relationships with teenage girls when the former judge was in his 30s, Moore persistently denied all of the charges.
But a lengthy list of prominent Republicans withdrew their support, including Senate Majority Leader Mitch McConnell, who said he believed the women who came forward to tell their painful stories.
Republican Richard Shelby, Alabama's senior senator, also said he could not support Moore, and Jeff Sessions, who held the seat before becoming attorney general, refused to say how he voted.
After the scandal broke, President Trump, who had supported Luther Strange in the Alabama GOP primary, distanced himself from Moore. The Republican National Committee also initially declined to contribute to his campaign.
But Trump, who couldn't seem to make up his mind, eventually backed Moore and appeared at a rally in the campaign's final days, just 20 miles from the Alabama border, declaring that the "future of the country" depended on his victory.
But at a rally in September, Trump had backed away, saying that "Luther is going to win easily, and Roy's going to have a hard time winning. But I will be backing him if he wins (the primary)."
Later, Trump turned against Moore once again, after the list of accusers lengthened. Ivanka Trump, the president's daughter and White House adviser, said there was "a special place in hell for people who prey on children."
"I've yet to see a valid explanation and I have no reason to doubt the victims' accounts," she said.
But a few days before Thanksgiving, Trump switched his opinion yet again, saying, "Look, he denies it."
"He says it didn't happen, and you know, you have to listen (to) him also," he told reporters.
By election day Tuesday, Trump was fully embracing Moore, recording a robocall and urging voters to go to the polls to vote for him.
"So get out and vote for Roy Moore. Do it, do it," Trump said.
Yet despite all of Moore's previous denials, exit polls showed that 52 percent of Alabama voters said they believed the women's allegations were "definitely" or "probably" true. Most of those believers voted for Democrat Doug Jones, by a margin of 89 percent to 8 percent.
The 43 percent of voters who said the allegations were "definitely" or "probably" untrue supported Moore by a 94 percent to 4 percent margin.
Notably, African-Americans were a key voting bloc in the election. They made up 29 percent of all Alabama voters and 96 percent of them voted Democratic.
Is this the beginning of the end in the largely Republican South? We'll know by next November.