US President Donald Trump fired FBI director James Comey in May 2017 -- a move that helped spark a counterintelligence investigation by the FBI, according to The New York Times (AFP Photo/Brendan Smialowski)

Washington (AFP) - The Federal Bureau of Investigation opened an inquiry in 2017 into whether US President Donald Trump was working on behalf of Russia, The New York Times reported on Friday.

The investigation -- a dual counterintelligence and criminal probe -- was launched after the president fired FBI director James Comey in May 2017, the Times said, citing anonymous sources.

The counterintelligence aspect consisted of determining whether Trump was knowingly or unknowingly working for Moscow and whether he was a threat to national security, the newspaper reported.

It added the criminal portion related to Trump's firing of Comey.

The FBI investigation was soon folded into Robert Mueller's inquiry into Russian interference in the 2016 vote and possible collusion between his campaign and Moscow, it said, adding that it was unclear if the counterintelligence aspect was still being pursued.

The Times said that the FBI had been suspicious of Trump's ties to Russia during the 2016 campaign.

But it held off on opening an investigation until the president sacked Comey, who refused to swear his allegiance and roll back the nascent Russia investigation, which is now being spearheaded by Mueller.

- A 'witch hunt'? -

Trump has repeatedly criticized the Mueller investigation as a "witch hunt" and views it as a stain on the legitimacy of his presidency.

But while Trump has slammed the probe as baseless, Mueller has issued dozens of indictments and steadily chalked up convictions of some of the president's close associates -- including his former national security advisor, his former personal lawyer, and his ex-campaign chief.

The ex-national security advisor, Michael Flynn pleaded guilty to lying to investigators about his Moscow ties.

The lawyer, Michael Cohen, has been sentenced to three years in prison for multiple crimes, including felony violations of campaign finance laws he undertook, prosecutors alleged, under Trump's direction.

And Trump's former presidential campaign chair, Paul Manafort, has been convicted in one case brought by Mueller and pleaded guilty in another, over financial crimes related to his work in Ukraine before the 2016 campaign, and for witness tampering.

Cell phone records show that Cohen was near Prague during the summer of 2016, supporting claims that he met there with Russian officials during the presidential election campaign, McClatchy news service has reported.

Cohen, who will testify in Congress on February 7, insists that he has never been to Prague, but added in a tweet: "#Mueller knows everything!"

As for Manafort, two pro-Russia Ukrainian oligarchs were the intended recipients of US polling data that Manafort admitted to sharing with a Russian during the 2016 presidential race, CNN reported.

Manafort admitted in a court filing to sharing the data with Russian political consultant Konstantin Kilimnik, who reportedly has intelligence ties, but denied lying about these dealings, claiming that he merely forgot details during the hectic campaign.

The specifics of the Mueller allegations were not previously known publicly, having been blacked out in a heavily redacted December 7 filing by the prosecutor's team.

But in Manafort's response, the electronic formatting for the redaction could easily be bypassed, revealing exactly what he was accused of lying about.

The Mueller investigation is set to continue to cast a cloud over the White House: a judge has given an extension to the secret grand jury empanelled in the probe, extending its original 18-month mandate.