While Republican Roy Moore and Democrat Doug Jones have the most riding on Tuesday’s special election for Senate in Alabama, President Trump is not far behind.

Almost alone among national Republican leaders, Trump has continued to support Moore after women came forward to accuse him of sexual misconduct with them when they were teenagers and the GOP senatorial nominee was in his 30s. Moore, 70, denied the charges, but even many members of his own party did not believe him.

Moore was on the verge of being abandoned by the national Republican Party after Senate Majority Leader Mitch McConnell, R-Ky., and National Republican Senatorial Committee Chairman Cory Gardner, R-Colo., both indicated they believed the women accusing him of misconduct.

But Trump’s endorsement drew the Republican National Committee and some national groups back into Alabama. If Moore wins, it could set up another confrontation with Senate Republicans, who have pledged to pursue an ethics investigation against him.

Trump, who has been accused of sexual harassment himself and faced calls from elected Democrats to resign, has strongly suggested he does not believe the women who came forward against Moore. And as someone who has frequently clashed with the media, calling them “fake news,” Trump was not inclined to believe the press reports about Moore’s past. Trump publicly questioned why the allegations against Moore, who was twice the chief justice of the Alabama supreme court, did not come out during any of his previous campaigns.

"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.”

Former Trump strategist Steve Bannon has been with Moore since the primary. At that time, Trump sided with other national Republican leaders in supporting appointed incumbent Sen. Luther Strange. Moore beat Strange in a primary runoff in September.

"There's a special place in hell for Republicans who should know better," Bannon said at a rally Monday night, perhaps making a play on Ivanka Trump’s anti-Moore comment that there is a special place in hell for people who prey on children.

Trump predicted during the primary that if Moore beat Strange despite the president’s endorsement, it would be politically damaging. "If Luther doesn't win, they're not going to say we picked up 25 points in a very short period of time,” he said. “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 true in the general election as well. A Moore defeat will be seen as a setback for Trump. If he wins, it will vindicate the president’s reading of the GOP base in Alabama. Trump did not campaign for Moore in the state but did repeat his endorsement at a rally in nearby Pensacola, Fla. Friday night and tweet out his support on election day.

The race between Moore and Jones was always closer than normal Senate campaign in Alabama, a ruby red state that Trump carried by 28 points last year. Jeff Sessions, now attorney general of the United States, was last re-elected to the seat in 2014 with more than 97 percent of the vote. Moore and Jones are vying to fill the remainder of his term, replacing Strange.

But allegations of sexual misconduct against Moore rocked the campaign, coming at a time when Hollywood icons like Harvey Weinstein and rising political stars like Sen. Al Franken, D-Minn., have seen their careers felled by such conduct. In Moore’s case, the 70-year-old has been accused by at least eight women of inappropriate behavior while he was in his 30s and they were as young as 14. Some have described Moore as engaging in sexual assault.

Moore has denied all the accusations and his supporters have tried to highlight what they see as inconsistencies in the accusers’ accounts. One has admitted to adding notes to a yearbook inscription that served as a piece of evidence the candidate and the accuser knew each other. The Moore camp has implied that the signature is a forgery and Trump expressed his own skepticism of its authenticity.

"Oh, what are we going to do? Gloria Allred, any time you see her you know something's going wrong," Trump told the crowd.

Nevertheless, Moore has had some inconsistencies himself, equivocating on whether he knew any of the women accusing him. In a radio interview with Sean Hannity after the first four accusers came forward, he left the door open to the possibility he dated women in their teens but above Alabama’s legal age of consent, adding he would have sought their mothers’ permission; he later slammed that door shut.

“I do not know them. I had no encounter with them. I never molested anyone. And for them to say that, I don’t know why they’re saying it, but it’s not true,” Moore told the Voice of Alabama Politics over the weekend.

Jones has enlisted national Democrats to come campaign for him, especially influential African-American leaders such as Sen. Cory Booker, D-N.J., and former Massachusetts Gov. Deval Patrick. “We need people like Doug who will make the government work and actually get something done,” former Vice President Joe Biden wrote in a fundraising appeal. “Folks who will make it possible again for parents to be able to look their kids in the eye and say it's going to be ok — and mean it.”

"Doug Jones is a fighter for equality, for progress," former President Obama said in a robocall. "Doug will be our champion for justice. So get out and vote, Alabama." Obama never received more than 38 percent of the vote in Alabama, losing its electoral votes in 2008 and 2012. Democrats have long worried that nationalizing the race would backfire.

But Obama, Booker, and Patrick hoped to boost black voter turnout. The polls are varying so widely in part because of conflicting assumptions about who will turn out in the special election. Such races are notoriously difficult to poll.

It is Trump, however, who may have the most skin in the game. "We cannot afford — this country, the future of this country — cannot afford to lose a seat in the very, very close United States Senate. We can't afford it, folks," Trump said. "We want jobs, jobs, jobs, so get out and vote for Roy Moore!"

We will soon learn if Alabama heeded the president’s advice.