President Donald Trump leads a roundtable discussion on border security with local leaders Friday in the Cabinet Room of the White House in Washington. Credit: Jacquelyn Martin | AP

WASHINGTON — The FBI investigation into President Donald Trump that was opened almost immediately after he fired then-Director James Comey also included a counterintelligence component to determine if the president was seeking to help Russia, and if so, why, according to people familiar with the matter.

The decision by then-acting FBI director Andrew McCabe to open an investigation of a sitting president was a momentous step, but it came after Trump had cited the ongoing investigation into Russian interference in the 2016 election in his decision to fire Comey, these people said.

The counterintelligence component of the Trump investigation was first reported by the New York Times.

Late Saturday night, Fox News host Jeanine Pirro asked Trump in an interview if he is or ever was working for Russia. Trump responded, “I think it’s the most insulting thing I’ve ever been asked.” Referring to the New York Times story, he went on, saying, “I think it’s the most insulting article I’ve ever had written.”

Trump earlier responded Saturday morning on Twitter, blasting former FBI leaders, criticizing their handling of an earlier investigation into Hillary Clinton and ripping the ongoing Russia probe. Trump has repeatedly denounced the FBI and Justice Department in such harsh terms, underscoring the gulf between the White House and the nation’s top law enforcement agencies in his administration.

“The corrupt former leaders of the FBI, almost all fired or forced to leave the agency for some very bad reasons, opened up an investigation on me, for no reason & with no proof, after I fired Lyin’ James Comey, a total sleaze!” the president tweeted. “My firing of James Comey was a great day for America. He was a Crooked Cop.”

McCabe was fired last year, and a grand jury is weighing possible charges against him for allegedly misleading investigators in a leak probe.

Counterintelligence investigations are different from criminal probes, in that their chief purpose is to understand what a foreign adversary like Russia is trying to do to influence American society or counteract U.S. policies, and if any Americans are assisting in those efforts, either knowingly or unwittingly.

In the case of the investigation into Trump, the FBI’s decision to open a file on the president so quickly after Comey’s firing in May 2017 was a source of concern for some officials at the Justice Department because the FBI acted without first consulting leadership at the department. But those worries were allayed when, days later, special counsel Robert Mueller III was appointed to oversee the Russia probe, according to people familiar with the matter who spoke on the condition of anonymity to discuss sensitive internal deliberations.

At the time the FBI began directly investigating Trump, it wanted to understand if he was attempting to obstruct justice by firing Comey and understand the reasons for his behavior, which also included comments in an NBC interview two days after Comey’s dismissal.

In that interview, Trump said, “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.’”

In addition to that statement, top bureau officials were also concerned about a draft letter to Comey that Trump had wanted to deliver but never did — with a belligerent and defensive tone — that made repeated references to Comey’s private statements to Trump that he wasn’t personally under investigation in the Russia probe, according to people familiar with the matter.

“The FBI sees [these actions] and it has two jobs: It needs to try to figure out why the person is behaving that way — that’s the counterintelligence part — and it needs to suss out whether that behavior is criminal in nature,” one official said. “It is hard to overstate how devastated the leadership of the bureau was when Comey was fired — not because they loved him, although many in the FBI did love him — but because it completely broke so many norms and appeared to be a move that had nothing to do with Comey and everything to do with the president’s own interests.”

The official said that the counterintelligence and criminal inquiries were always linked.

Rep. Jim Himes, D-Connecticut, a member of the House Intelligence Committee, said the revelations are disturbing. “A lot of the behavior which has sent people to jail — largely about lying about Russia — occurred before the firing of Comey,” he said in an interview. “So if the FBI had concerns that the president was wittingly or unwittingly acting in the Russians’ interests as late as the firing of Jim Comey, that’s a pretty scary thought — especially since we don’t know what else they [the investigators] know.”

He added that “the FBI opening any investigation is a highly documented, well-considered and well-reviewed process. This one would have been particularly carefully undertaken.”

Washington Post writer Josh Dawsey contributed to this report.