President Donald Trump speaks to reporters with Vice President Mike Pence (R) and U.S. Senators' John Barrasso (R-WY) and John Thune (R-SD) after Trump addressed a closed Senate Republican policy lunch while a partial government shutdown enters its 19th day on Capitol Hill in Washington, U.S., January 9, 2019.

Federal investigators, alarmed by President Donald Trump's behavior in the immediate aftermath of his firing in 2017 of former FBI director James Comey, opened a probe into whether the president had been secretly working with Russia, The New York Times reported late Friday.

Citing unnamed sources familiar with the investigation, the publication said that counterintelligence officials weighed whether Trump's actions were undermining national security, and whether he was either working at the behest of Moscow, or was somehow influenced by the Kremlin.

Trump has repeatedly denied that he colluded with Russia, while even Comey has stated publicly that Trump himself was not a focus of the FBI's probe into his campaign's ties to Moscow. In a lengthy diatribe on Twitter, the president blasted The Times, and renewed his critique of the former FBI director as "a total sleaze" and a poor leader.

Twitter

Trump tweet2

Allegations that Trump was somehow compromised by Russia were first broached by the controversial Steele dossier, a raw intelligence document assembled by a former British spy that was interspersed with lurid and largely uncorroborated accusations against the president.

The Times reported on Friday that agents and senior FBI officials had their suspicions aroused about Trump's ties to Russia during the 2016 election, but refrained from opening an investigation into him because of how sensitive the undertaking would be. However, sources told the publication that on two occasions, Trump tied Comey's dismissal to the Russia probe, which led to a counterintelligence track being added to the original Russia inquiry.

In theory, Comey's axing would constitute obstruction, because of the impact it would have had on the FBI's ability to learn about Moscow's meddling, and whether U.S. citizens were involved. On Saturday, Trump reiterated his position that he's been far tougher on Russian than any of his predecessors.

Russia tweet

According to The Times report, it's unclear if Special Counsel Robert Mueller is still pursuing the counterintelligence probe as he pursues a wide ranging investigation into whether campaign officials, or Candidate Trump himself, knew of Russia's efforts to influence the election. Still, the investigation into whether the president obstructed justice by firing Comey was lumped in with the counterintelligence inquiry, according to former law enforcement officials who spoke with the Times.

Rudolph W. Giuliani, Trump's personal lawyer and the former mayor of New York City, dismissed the counterintelligence effort. "The fact that it goes back a year and a half and nothing came of it that showed a breach of national security means they found nothing," Giuliani told The Times on Friday, but added that he had no insight into that particular track of the investigation.

A spokesperson for the FBI did not immediately respond to CNBC's request for comment.

The Times' full report can be found on its website.