Donald Trump has hinted he believes the probe into Russian interference in US elections is illegal, the latest in a line of thinly veiled attacks that critics say are aimed at undermining the independent investigation.

The US president fired off the astonishing suggestion in one of his infamous late night Twitter posts.

He claimed the special counsel probe looking into Moscow’s links with his 2016 campaign was set-up following an illegal media leak – and seemed to conclude that meant the whole process was illegitimate.

“James Comey illegally leaked classified documents to the press in order to generate a Special Council? [sic]” he wrote. “Therefore, the Special Council was established based on an illegal act? Really, does everybody know what that means?”

Mr Trump has repeatedly called the enquiry – led by Robert Mueller – a politicised witch hunt. But the new outburst appears to go further by suggesting it should be ended according to US law.

The claim came just a day after Rudy Giuliani – the combative former Mayor of New York – revealed he had joined Mr Trump’s legal term and was aiming to bring an end to the enquiry. 

Yet many have already dismissed the president’s tweeted conclusions.

The leak referred to was a memo which former FBI director Mr Comey wrote documenting  a 2017 meeting with Mr Trump, during which the president allegedly asked him to drop an FBI investigation into former national security adviser Michael Flynn. 

Mr Comey revealed the memo to The New York Times after he was fired, apparently out of concern the president had tried to obstruct justice.

Just one day after the newspaper ran the story on 16 May, Mr Mueller was appointed special counsel by Deputy Attorney General Rod Rosenstein.

But Mr Comey has previously said the memo contained no classified information and was, therefore, not an illegal leak.

In testimony to the Senate Intelligence Committee last June, he said: “If I write it in such a way that doesn’t include anything of a classification, that would make it easier for us to discuss within the FBI, and the government, and to hold onto it in a way that makes it accessible to us.”

Despite Mr Trump’s continual criticism, the Mueller probe has evolved dramatically over the last year, and has resulted in a number of federal charges, indictments and pleas involving some of the president’s closest aides and some Russian operatives.

Earlier this month, in a surprising raising of stakes, the offices and homes of Mr Trump’s personal attorney, Michael Cohen, were raided by investigators.

Prosecutors have not yet brought any charges specifically related to collusion.