Alabama Republican Senate candidate Roy Moore lost a campaign communications director the day after he gained a quasi-endorsement from the president of the United States.

After weeks of mixed messages from the White House, President Trump finally threw Moore a pre-Thanksgiving lifeline. He told Alabama Republicans to vote against Moore’s Democratic opponent Doug Jones, a “liberal person.” And he repeated that Moore has denied all the allegations of sexual misconduct that have been made against the socially conservative former state judge.

If Trump stopped just short of endorsing Moore’s candidacy, he nevertheless endorsed those denials. "Forty years is a long time. He's run eight races, and this has never come up," the president said. "All you can do is, you have to do what you have to do. [Moore] totally denies it.”

Trump even suggested he might be willing to campaign for Moore ahead of the Dec. 12 special election, even though White House press secretary Sarah Sanders has said the president was on board with the national GOP’s decision to pull the plug on the embattled Senate candidate.

The president is taking a big risk here. Neither the facts nor the number of allegations against Moore have gotten better, despite the frequency with which his campaign has hinted it may be able to show one accuser’s yearbook signature from Moore was a forgery.

This Doug Jones ad featuring the accusers is devastating.

The polls have certainly gotten worse: Moore has led outside the margin of the error in exactly one survey since the initial report suggesting he had a penchant for underage girls as a man in his 30s.

Jones now leads in the RealClearPolitics polling average for the race by 0.8 points. The last Democrat elected to the Senate from Alabama, Richard Shelby, was so conservative he could seamlessly become a Republican in 1994 and hold on to the seat to this day. When the seat Moore is seeking was last up in 2014, there wasn’t even a Democratic challenger.

Trump is tying his political fortunes in Alabama to a flailing candidate. Maybe he can save Moore. He will certainly no longer have clean hands if Moore loses.

Moreover, the sexual harassment scandals are starting to shift away from the Republicans to the Democrats. While no one besides Moore stands accused of pursuing a romantic or sexual relationship with a 14-year-old girl and Rep. Joe Barton, R-Texas, is the latest name in the headlines, Sen. Al Franken, D-Minn., and Rep. John Conyers, D-Mich., pose real problems for the Democratic Party.

Conyers was in line to chair the House Judiciary Committee — the panel that would handle impeachment proceedings — if Democrats were to retake the House in 2018. Now a messy fight over whether Conyers should get the gavel has become even messier. Franken was a major fundraiser for the party and an ascendant progressive political figure.

Until Trump’s intervention, national Republican leaders had closed ranks against Moore, while Democrats were still debating what to do about Franken and Conyers. Trump has complicated that narrative by siding with Moore and his Alabama GOP defenders over the Republican congressional leadership, and if his semi-endorsement is successful it will create a dilemma for Senate Majority Leader Mitch McConnell, R-Ky.: Must he now follow through on promises to expel Moore after an electoral triumph and right in the middle of tax reform?

Trump has taken risks in the Alabama Senate race before. He endorsed appointed Sen. Luther Strange, R-Ala., even when it was clear rank-and-file Republicans had major concerns about the circumstances under which he had obtained his seat. And he traveled to the state to campaign for Strange even when it was clear that Moore was leading in the polls.

"I might have made a mistake and I'll be honest I might have made a mistake," Trump told the crowd at the rally for Strange. "If Luther doesn't win, they're not going to say we picked up 25 points in a very short period of time. They're going to say Donald Trump, the president of the United States, was unable to pull his candidate across the line. It is a terrible, terrible moment for Trump. This is total embarrassment."

That is more or less what was said after Moore easily beat Strange. Which makes it even odder that Trump is risking history repeating itself in the general election: Up until this week, he could always say he warned Republicans against voting for Moore.

"But I have to say this, and you understand this and just look at the polls, Luther will definitely win," Trump said before the primary. "Roy has a very good chance of not winning in the general election. It's all about the general.”

In the end, Trump could not resist siding with Moore and former White House strategist Steve Bannon after going through sexual harassment allegations and the “Access Hollywood” tape fallout himself.

Now Trump is risking it all again in Alabama with far greater implications for the Republican brand.