President Trump on Wednesday took to Twitter to deny that he fired James B. Comey as FBI director because of the bureau’s “phony” investigation into Russian interference in the 2016 elections, including possible interaction with the Trump campaign.

The tweet came shortly after an appearance by Comey on NBC’s “Today” show to promote his new book, during which he said there “could be” an obstruction-of-justice case to be made against Trump, given the circumstances under which Comey was fired.

“Slippery James B. Comey, the worst FBI Director in history, was not fired because of the phony Russia investigation where, by the way, there was NO COLLUSION (except by the Dems)!” Trump wrote on Twitter.

During the “Today” segment, anchor Savannah Guthrie referred to comments Trump made in a May interview with NBC’s Lester Holt that suggested that Trump’s rationale for firing Comey included the FBI’s Russia investigation.

“When I decided to just do it, I said to myself, I said, ‘You know, this Russia thing with Trump and Russia is a made-up story, it’s an excuse by the Democrats for having lost an election that they should’ve won,’ ” Trump told Holt in that interview.

On Wednesday, Guthrie asked Comey whether someone could bring an obstruction case against Trump based on those comments.

“You might,” Comey said. “It would depend on what all the other facts are around that.” He later said it “could be obstruction of justice.”

In a later Wednesday morning appearance on ABC’s “The View,” Comey was asked about Trump’s latest tweet. He noted the contrast with the president’s previous statement about having the Russia probe on his mind when he decided to fire Comey.

“Both of those things can’t be true,” Comey said. “It matters that the president is not committed to the truth as a central American value.”

The interviews were the latest in a media blitz by Comey in support of his tell-all book, “A Higher Loyalty: Truth, Lies, and Leadership,” which describes Trump’s presidency as a “forest fire” and portrays the president as an ego-driven congenital liar.

Trump has lashed out repeatedly against Comey in the run-up to the book’s release. In a tweet last week, Trump called Comey a “weak and untruthful slime ball” who deserved to “be fired for the terrible job he did.”

During the “Today” interview, Guthrie also asked Comey why, as FBI chief at the time, he didn’t tell Trump that his behavior toward the bureau was inappropriate. Among other things, Comey has said that Trump asked him for his loyalty and to lay off then-national security adviser Michael Flynn, who was under investigation.

“Well, I guess the question is, ‘What does standing up mean in that context?’ ” Comey said. “I stared at him, didn’t blink, didn’t make a sound.”

Pressed by Guthrie, Comey said, “I don’t know whether I should have done it differently, but in the moment it seemed like the thing to do was make sure you’re not agreeing to something inappropriate.”

On “The View,” Comey said he regretted the section of his book in which he described the president’s appearance — making a sly reference to the size of his hands and speculating that Trump had white circles under his eyes from tanning goggles.

Some reviewers of the book have accused Comey of engaging in the kind of superficial judgments of people’s physical appearances that, they argue, is a trademark of Trump and not befitting a former FBI director.

“If I had to do it over again, I wouldn’t put that paragraph in,’’ Comey said. “I wasn’t trying to pick on his hands. . . . That was not my intention, but I do see people seize on that as a distraction.”