President Trump, seen here in a file photo, on Wednesday said he knew Roy Moore couldn’t win the U.S. Senate race in Alabama. (Jabin Botsford/The Washington Post)

In the days leading up to the Alabama Senate election, President Trump called Roy Moore to endorse him, touted his candidacy at a rally just across the state line and recorded a robo-call in which he described Moore as “the guy we need.”

On the day after Moore lost the election, Trump said he saw it coming.

In a morning tweet, the president relayed that he had originally endorsed another Republican for the seat because "I said Roy Moore will not be able to win the General Election."

“I was right!” the president exclaimed.

Trump, it turns out, is rarely, if ever, wrong — at least as he tells it. Since his emergence as a presidential candidate, he has repeatedly refused to accept blame for setbacks or admit he’s made a mistake. Instead, the president is quick to try to shift responsibility, deny he ever did something in the first place or otherwise dissemble.

After the loss of Luther Strange, the Alabama candidate Trump endorsed in the GOP primary, he literally tried to erase history: Trump deleted several tweets in which he had urged Alabamians to vote for "Big Luther," whom Trump had claimed "will never let you down."

“Anybody who works in politics knows it’s part of the job to deflect blame as much as possible,” said Doug Heye, a Republican consultant and former communications director for the Republican National Committee. “But Trump has taken that to levels previously unheard of. He often tries to rewrite history and minimize his involvement.”

In many instances, Trump has continued to stick by discredited assertions rather than acknowledge he misspoke or relayed faulty information.

During the campaign, Trump doubled down on a claim that he saw "thousands" of Muslims celebrating in New Jersey after the terrorist attacks of Sept. 11, 2001 — even after police and others said the claim was unfounded.

Trump later disavowed his role in promoting a theory that former president Barack Obama, the nation’s first African American president, was born outside the United States — instead falsely blaming the campaign of Democrat Hillary Clinton for starting the controversy.

And as president, Trump asserted and reasserted that Obama ordered surveillance on Trump Tower during the campaign, insisting that forthcoming evidence — which never materialized — would prove him right.

When the Republican health-care bill failed in September, there was plenty of finger pointing, including some in Trump’s direction for not having done more to sell the legislation to a skeptical public and lobby wavering senators.

Trump offered an alternative explanation: that he would have had the votes except for the hospitalization of a senator.

It turned out that the senator in question — Republican Thad Cochran of Mississippi — wasn’t in the hospital but was recovering from what an aide described as a urological issue.

But even if Cochran had been present, the GOP leadership would have been short of the votes needed to pass a bill that no Democrats were supporting. Three Republicans had announced they were firm “no” votes, and others had expressed skepticism about the bill.

In October, the Trump administration came under sharp criticism for its response to hurricane-ravaged Puerto Rico, including from San Juan Mayor Carmen Yulín Cruz, who pleaded on television for more help from a federal government that she said “was killing us with the inefficiency and the bureaucracy.”

Rather than acknowledge shortcomings, Trump attacked Cruz on Twitter as “nasty” and later gave his administration a grade of 10 out of 10 when a reporter asked him to rate the federal response.

“I would say it’s a 10,” Trump said, arguing that the destruction wrought by Hurricane Maria “was in many ways worse than anything people have ever seen.”

“It went right through the middle of the island, right through the middle of Puerto Rico,” Trump said.

Trump’s assessment was at odds with public polling — at the time, fewer than half of Americans approved of how he was handling the succession of hurricanes this year.

Trump’s proclivity to move on — whatever the circumstances — has long been recognized.

During a 2015 appearance on “The Tonight Show,” he told host Jimmy Fallon: “I fully think apologizing is a great thing, but you have to be wrong. I will absolutely apologize sometime in the distant future if I’m wrong.”

In the case of Moore, there was some truth to what Trump tweeted on Tuesday morning.

The day before Alabama’s GOP primary runoff in September, Trump called into the “Rick & Bubba Show,” a syndicated radio program based in Alabama that airs across the South.

Trump was asked to explain why he was backing Strange, who was struggling in the polls against Moore, a candidate more in sync with much of Trump’s political base.

“He will absolutely win against the Democrat,” Trump said of Strange, “whereas Ray’s going to have a hard time; you know that.”

When one of the hosts pointed out that Moore’s first name was actually Roy, Trump brushed off his mistake, saying it was more illuminating about Moore than him.

“I don’t know Roy Moore at all,” Trump said. “And I think it’s perhaps indicative when somebody doesn’t even know his name. You know, that’s not a good sign — for him.”

Trump was also slippery when he was fact-checked in real time earlier in his presidency, when he asserted at a news conference that his victory over Clinton was “the biggest electoral college win since Ronald Reagan.”

NBC’s Peter Alexander challenged Trump, listing electoral college victories bigger than Trump’s, including both of Barack Obama’s elections, both of Bill Clinton’s elections and George H.W. Bush’s 1988 victory — all since Reagan.

“Well, I was talking about Republicans,” Trump said, before Alexander pointed out that Bush was a Republican.

“Well I don’t know, I was given that information,” Trump then said. “Actually, I’ve seen that information around. But it was a very substantial victory; do you agree with that?”