Former US security officials have issued scathing rebukes to Donald Trump for withdrawing a former spy chief’s security clearance in what they cast as an act of political vengeance.

The president insisted he had to do “something” about the “rigged” federal probe of Russian election interference.

His admission that he acted out of frustration about the Russia probe underscored his willingness to use his executive power to fight back against an investigation he sees as a threat to his presidency.

Legal experts said the dispute may add to the evidence being reviewed by special counsel Robert Mueller.

In an opinion piece in the New York Times, former CIA director John Brennan said Mr Trump’s decision to deny him access to classified information was a desperate attempt to end Mr Mueller’s investigation.

Mr Brennan, who served under Barack Obama and has become a vocal Trump critic, called the president’s claims that he did not collude with Russia “hogwash”.

The only question remaining is whether the collusion amounts to a “constituted criminally liable conspiracy”, Mr Brennan wrote.

Later, the retired navy admiral who oversaw the raid that killed Osama bin Laden called Mr Trump’s moves “McCarthy-era tactics”.

Writing in the Washington Post, William H McRaven said he would “consider it an honour” if Mr Trump would revoke his clearance as well.

“Through your actions, you have embarrassed us in the eyes of our children, humiliated us on the world stage and, worst of all, divided us as a nation,” Adm McRaven wrote.

That was followed by a joint letter from 12 former senior intelligence officials calling Mr Trump’s action “ill-considered and unprecedented”.

They said it “has nothing to do with who should and should not hold security clearances — and everything to do with an attempt to stifle free speech”.

The signatories included six former CIA directors, five former deputy directors and former director of national intelligence James Clapper.

Two of the signatories — Mr Clapper and former CIA director Michael Hayden — have appeared on a White House list of people who may also have their security clearances revoked.

Mr Trump on Wednesday openly tied his decision to strip Mr Brennan of his clearance — and threaten nearly a dozen other former and current officials — to the investigation into Russian election meddling and possible collusion with his campaign.

In an interview with the Wall Street Journal, he again called the probe a “rigged witch hunt” and said “these people led it!”

“So I think it’s something that had to be done,” he said.

The president’s comments were a swift departure from the official explanation given by the White House earlier on Wednesday that cited “the risks” posed by Brennan’s alleged “erratic conduct and behaviour”.

Mr Trump said later that he suspects he will “very quickly” revoke the security clearance for a Justice Department official whose wife worked for the firm involved in producing a dossier on Trump’s ties to Russia.

Signalling that his efforts to target clearances over his frustration with the Russia investigation were not over, Mr Trump tweeted that it was a “disgrace” for Bruce Ohr to be in the Justice Department.

Mr Ohr has come under Republican scrutiny for his contacts to Glenn Simpson, co-founder of Fusion GPS. The opposition research firm hired former British spy Christopher Steele during the 2016 presidential campaign to compile the dossier on Mr Trump and his Russia ties.

Mr Ohr’s wife Nellie worked for Fusion GPS during the campaign — something Mr Trump has tweeted about to highlight his assertions of political bias behind the Russia investigation.