President Trump on Thursday said he was thinking of “this Russia thing with Trump” when he decided to fire FBI Director James B. Comey, who had been leading the counterintelligence investigation into Russia’s interference in the 2016 election.

Recounting his decision to dismiss Comey, Trump told NBC News, “In fact, 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 have won.’”

Trump’s account flatly contradicts the White House’s initial account of how the president arrived at his decision, undercutting public denials by his aides that the move was influenced in any way by his growing fury with the ongoing Russia probe.

Later in the same interview, Trump said he had no intention of trying to stop or hinder the FBI’s Russia probe, which is examining whether any Trump associates coordinated with Russians to influence the election. Trump also said he wants the probe “to be absolutely done properly.”

“I want that to be so strong and so good,” Trump told NBC anchor Lester Holt. He added, “I want to get to the bottom. If Russia hacked, if Russia did anything having to do with our election, I want to know about it.”

Trump’s account of his decision to fire Comey — whom he denigrated as “a showboat” and “a grandstander” — exposes the explanations made over the previous 48 hours by White House officials, including Vice President Pence, as misleading and in some cases false.

Initially, Trump aides had said the president fired Comey simply at the recommendation of Attorney General Jeff Sessions and Deputy Attorney General Rod J. Rosenstein, who wrote a memorandum detailing what he considered to be Comey’s flawed handling of the investigation into Hillary Clinton’s use of a private email server as secretary of state.

In media appearances, administration officials repeatedly highlighted Rosenstein’s reputation of integrity and bipartisan appeal, effectively using his independence as a shield against criticism that Comey’s firing was politically motivated by the president.

Officials insisted that Trump’s decision was not shaped in any way by his growing fury with the Russia controversy. Trump has publicly called the ongoing probes by the FBI, as well as the Senate and House, “a total hoax” and “a taxpayer charade.”

But Trump made clear in Thursday’s interview that Russia indeed was on his mind. And he said Sessions and Rosenstein’s recommendations did not prompt his decision.

“I was going to fire Comey,” Trump told Holt. “Oh, I was going to fire regardless of recommendation.”

(Bastien Inzaurralde,Alice Li,Jayne Orenstein/The Washington Post)

The White House on Thursday struggled to explain its evolving and contradictory accounts of Trump’s decisionmaking process.

“Nobody was left in the dark,” Sarah Huckabee Sanders, the principal deputy White House press secretary, insisted at Thursday’s press briefing. She added, “It was a quick-moving process. We took the information we had as best we had it, and got it out to the American people as quickly as we could.”

In interview, Trump also detailed three conversations he said he had with Comey about the Russia investigation. The president said the FBI director assured him in each discussion that he was not under investigation — once at a White House dinner when Comey was seeking to remain in his post and again in two phone calls. Trump said Comey initiated one of the calls.

“I said, ‘If it’s possible, would you let me know am I under investigation?’ He said, ‘You are not under investigation,’’’ Trump said.

In offering more details about an assertion he made when firing Comey on Tuesday—that Comey had repeatedly assured him he was not under investigation—the president raised new questions about his conduct toward the ongoing FBI probe into whether any Trump associates coordinated with Russia to meddle with last year’s presidential election.

Trump has repeatedly criticized that investigation, calling it a waste of taxpayer money, and denied he has any ties to Russia.

“There’s no collusion between me and my campaign and the Russians,” Trump told Holt.

Democrats have called for the appointment of a special counsel to investigate the matter without the threat of political interference.

In the NBC interview, Trump said Comey came to eat dinner with him at the White House. “I think he asked for the dinner. . . . And he wanted to stay at the FBI, and I said I’ll, you know, consider and see what happens … But we had a very nice dinner, and at that time he told me, ‘You are not under investigation.’ ’’

The exchange as described by the president is remarkable since he said the FBI director was discussing an ongoing investigation with the president — something Justice Department policy generally prohibits — at the same time Comey was seeking assurances he would remain in his job.

Current and former officials said Trump’s description of statements by Comey is not accurate, but they declined to elaborate. Legal experts also expressed doubts about Trump’s account.

“I just can’t even begin to think about that comment being true,’’ said Michael Greenberger, a law professor at the University of Maryland who has previously worked in the Justice Department. “It defies belief in general because of the practices of not commenting on investigations, and it would especially defy belief in the case of Comey who prides himself on strict observance of propriety.’’

Greenberger noted the implication of Trump’s statement is severe – that Comey may have offered that assurance to try to ingratiate himself with the president and remain in his job. “I just have a very hard time imagining that,’’ he said, though he added he also didn’t think Trump simply asking that question came close to a criminal act of trying to obstruct the investigation.

The federal law against obstruction of justice is broadly worded but in practice, prosecutors have a high bar for bringing charges that someone “corruptly or by threats or force, or by any threatening letter or communication’’ attempts to “influence, obstruct, or impede the due administration of justice.’’ Generally, such cases are only brought when prosecutors have clear evidence of the underlying motive behind a person’s actions.

White House spokeswoman Sanders would not provide further details about the conversations between Trump and Comey, such as when they occurred and whether all three were after the president’s Jan. 20 inauguration. She said commentary by legal experts on cable news showed there had been no conflict of interest with Trump asking the FBI director whether he was the subject of the Russia probe.

Robert Chesney, a University of Texas law professor who specializes in national security and constitutional issues, said that even assuming Trump’s account is accurate, “legally speaking, I don’t think that crosses any lines.’’

At base it is more a political issue than legal, he said. Offering a more extreme hypothetical—that Trump began firing anyone involved in the investigation—that could come closer to obstruction of justice. But then it would be a matter for Congress to act. “Our system is designed so that impeachment is the remedy,’’ he said. “But the fact pattern you’d need is something more Nixonian.”

FBI directors are appointed for 10-year terms, and Comey had been on the job less than four years. A president may fire an FBI director at any time for any reason, but it is very rare to do so because of the potential political blowback if the White House is perceived to be interfering with federal law enforcement work.

Comey’s temporary replacement, Andrew McCabe, told senators at a hearing Thursday morning that no White House officials had tried to interfere with the Russia probe.

In the interview, Trump said he fired Comey because he had mismanaged the FBI and was an attention-seeker.

“Look, he’s a showboat, he’s a grandstander,” the president said. “The FBI has been in turmoil. You know that. I know that. Everybody knows that. You take a look at the FBI a year ago, it was in virtual turmoil, less than a year ago. It hasn’t recovered from that.”