Former CIA Director John Brennan is criticizing President Donald Trump's decision to revoke Brennan's security clearance.

Brennan wrote in an article published Thursday that Trump was "becoming more desperate to protect himself and those close to him" amid the Russia investigation.

He tweeted Wednesday that the decision was "part of a broader effort by Mr. Trump to suppress freedom of speech & punish critics."

He also likened the action to things he had seen from "foreign tyrants, despots, and autocrats" throughout his career.

Former CIA Director John Brennan is criticizing President Donald Trump's decision to take away Brennan's security clearance, accusing Trump of "becoming more desperate to protect himself and those close to him" as the special counsel Robert Mueller continues investigating the president's ties to Russia.

The White House press secretary, Sarah Huckabee Sanders, announced Wednesday that Brennan, who led the agency from 2013 to 2017, was losing his security clearance. In an article published Thursday in The New York Times, Brennan wrote that Trump's decision was "politically motivated" and that the president's claims of no collusion with Russia were "in a word, hogwash."

"The only questions that remain are whether the collusion that took place constituted criminally liable conspiracy, whether obstruction of justice occurred to cover up any collusion or conspiracy, and how many members of 'Trump Incorporated' attempted to defraud the government by laundering and concealing the movement of money into their pockets," he wrote.

He added: "Mr. Trump clearly has become more desperate to protect himself and those close to him, which is why he made the politically motivated decision to revoke my security clearance in an attempt to scare into silence others who might dare to challenge him."

Photos of Robert Mueller and Donald Trump. Shayanne Gal/Business Insider; Alex Wong/Getty; Jonathan Ernst/Reuters

Brennan told the MSNBC "Deadline" host Nicolle Wallace that he was blindsided by the move, finding out from Sanders' afternoon press briefing along with the public.

"Revoking my security clearances is his way of trying to get back at me," Brennan said. "I think I have tried to voice the concerns of millions of Americans about Mr. Trump's failures, in terms of fulfilling the responsibilities of that sacred and solemn office of the presidency."

Brennan also tweeted out against the move on Wednesday.

"This action is part of a broader effort by Mr. Trump to suppress freedom of speech & punish critics," he wrote. "It should gravely worry all Americans, including intelligence professionals, about the cost of speaking out.

"My principles are worth far more than clearances. I will not relent."

A prominent and outspoken critic

Brennan has been a prominent, outspoken critic of Trump's approach to foreign policy and national security. Recently, he was among the sharpest critics of Trump's Helsinki summit with Russian President Vladimir Putin, referring to Trump's seemingly siding with Moscow over the issue of election meddling as "treasonous."

On Monday, Brennan tweeted that Trump "will never understand what it means to be president, nor what it takes to be a good, decent, & honest person" in response to Trump's referring to the former White House staffer Omarosa Manigault Newman as a "crazed, crying lowlife" and "that dog."

"I've seen this type of behavior and actions on the parts of foreign tyrants, despots, and autocrats for many, many years during my CIA and national security career," he told Wallace of his security-clearance revocation, adding, "I never, ever thought I'd see it here in the United States."

Brennan said he was worried Trump was sending a message to other former and current officials with security clearances that they shouldn't say critical things about the president.

Trump has said he is considering revoking the clearance of several other former intelligence and law-enforcement officials — many of whom have been publicly critical of him — in the coming weeks.

But several of the officials identified by the White House for review may not even have active security clearances to revoke.

Former FBI Director James Comey and former Deputy Director Andrew McCabe both had their clearances revoked upon their termination from the FBI, and attorney general Jeff Sessions said in June that former agent Peter Strzok had lost his clearance while under internal review before his August 13 firing.

"If Mr. Trump believes that this is going to lead me to just go away and be quiet, he is very badly mistaken," Brennan said on MSNBC.

Watch a clip from Brennan's interview below:

—Deadline White House (@DeadlineWH) August 15, 2018

Here's a graphic breakdown of how the system works: