WASHINGTON — President Donald Trump’s switch from once commending now-ousted FBI Director James Comey to this week condemning him was a transition from campaigning to governing, a White House spokeswoman said Wednesday.

“You’re looking at two very different positions,” Sarah Huckabee Sanders told reporters. “The president was wearing a different hat at that time. He was a candidate, not the president.”

Among other instances of praise, Trump in October said “it took a lot of guts” for Comey to announce a revived investigation into Hillary Clinton’s emails just before the election.

On Wednesday, Trump tweeted that the “prestige of the FBI” would be restored by a different leader after agreeing with a Justice Department recommendation a day earlier that Comey should be dismissed over his handling of the Clinton probe.

The decision to fire Comey sent shockwaves through Washington, D.C., and prompted calls across the aisle for an independent prosecutor to probe into Russian meddling in the election — something Comey was overseeing.

Huckabee Sanders said the ouster was about Comey’s conduct, not the ongoing investigation into Kremlin interference.

advertisement | advertise on newsday

“Any investigation that was happening on Monday is still happening today,” she said of FBI operations, reiterating that no evidence has emerged of collusion between the Trump team and the Russians and adding that no one wanted to see the probe completed more than the White House.

Trump had met earlier Wednesday with Russian Foreign Minister Sergey Lavrov, Russian Ambassador Sergey Kislyak and other officials in an Oval Office gathering that was closed to American reporters. The White House said Trump and Lavrov discussed Syria and Ukraine, among other topics.

The president later hosted former Secretary of State Henry Kissinger, who was present when Trump gathered reporters and told them he fired Comey because, “very simply, he was not doing a good job.”

In the dismissal letter dated Tuesday, Trump told Comey he agreed with the deputy attorney general’s conclusion that Comey cannot effectively lead the FBI, writing also, “I greatly appreciate you informing me, on three separate occassions, that I am not under investigation.”

Huckabee Sanders was asked repeatedly about those conversations and when they occurred but she would not provide details.

The president had been intent on dismissing Comey since Trump’s first day in office, she said, citing an “erosion of confidence.”

Trump in April told Fox Business that he had full confidence in Comey and Press Secretary Sean Spicer last week said the same.

The president responded early Wednesday via Twitter to the fallout among Democrats and Republicans by predicting, “When things calm down, they will be thanking me!”

Huckabee Sanders and Trump pointed to the turnaround by the Democrats who previously condemned Comey for potentially hurting Clinton’s chances at the White House and now say he was improperly fired.

“The very Democrats that are criticizing the president today would be dancing in the street celebrating,” she said of what she envisioned would have been a Comey ouster by a President Clinton. “It’s just the purest form of hypocrisy.”

advertisement | advertise on newsday

Trump shared the sentiment on Twitter: “Dems have been complaining for months & months about Dir. Comey. Now that he has been fired they PRETEND to be aggrieved. Phony hypocrites!”

With Tom Brune