WASHINGTON — President Trump again insisted Thursday that he did not fire former FBI director James Comey because of the Russia investigation, blaming the “Corrupt Mainstream Media” for pushing a false storyline.

The president’s assertion, in a morning tweet, is at odds with comments he made in a television interview last year in which he said Comey’s stewardship of the Russia probe was on his mind when he made his decision to dismiss him.

“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 NBC’s Lester Holt in a May 2017 interview.

Before the NBC interview, the White House had said Trump fired Comey at the recommendation of senior Justice Department officials who said he had treated Hillary Clinton unfairly and damaged the credibility of the FBI and the Justice Department.

“Regardless of the recommendation I was going to fire Comey,” Trump told Holt.

In his tweet on Thursday, Trump made no mention of another rationale for his decision to fire Comey, but wrote: “Not that it matters but I never fired James Comey because of Russia! The Corrupt Mainstream Media loves to keep pushing that narrative, but they know it is not true!”

Trump last month wrote that Comey “was not fired because of the phony Russia investigation.”

The probe, now led by special counsel Robert Mueller, is examining both Russian interference in the 2016 election and possible coordination between the Trump campaign and Russia. Trump’s firing of Comey has also come under review as Mueller weighs a possible obstruction of justice case against the president.

In a separate tweet Thursday, Trump continued to insist that the FBI had spied on his 2016 campaign and claimed that the media “is working overtime” to avoid reporting about it.

An FBI source, former University of Cambridge professor Stefan A. Halper, had contact with at least three advisers to Trump during the campaign. There is no evidence to suggest however, that Halper was inserted into the Trump campaign, as the president has suggested.

Among those who have pushed back against Trump’s spying claims are Rep. Trey Gowdy, R-S.C., who was one of the lawmakers briefed on the FBI actions.

Gowdy told Fox News on Tuesday night that the briefing vindicated the FBI.

“I am even more convinced that the FBI did exactly what my fellow citizens would want them to do when they got the information they got, and that it has nothing to do with Donald Trump,” he said.

Trump’s latest tweets come as he and his lawyers step up attacks on Mueller’s investigation in a bid to undermine the credibility of its findings.

On Wednesday night, Trump lawyer Rudy Giuliani referred to Mueller’s team as “a lynching mob” during an appearance on the FOX News program “Hannity.”