WASHINGTON — President Donald Trump announced Wednesday that he was revoking the security clearance of former CIA Director John Brennan, a prominent and frequent critic, citing what the president called his “erratic conduct and behavior.”

Press secretary Sarah Huckabee Sanders made the announcement at the start of a previously unscheduled media briefing at the White House. She said Trump is also considering taking the same highly unusual action against nine additional former national security officials — all Trump critics — who served in the Barack Obama or George W. Bush administrations, or both.

“Any benefits that senior officials might glean from consultations with Mr. Brennan are now outweighed by the risks posed by his erratic conduct and behavior,” Sanders said, reading from a statement by the president.

That statement also alleged that Brennan “has recently leveraged his status as a former high-ranking official with access to highly sensitive information to make a series of unfounded and outrageous allegations — wild outbursts on the internet and television — about this Administration.”

It continued: “Mr. Brennan’s lying and recent conduct, characterized by increasingly frenzied commentary, is wholly inconsistent with access to the Nation’s most closely held secrets and facilitates the very aim of our adversaries, which is to sow division and chaos.”

Brennan soon responded on Twitter: “This action is part of a broader effort by Mr. Trump to suppress freedom of speech & punish critics. 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.”

Sanders named nine more individuals whose clearances are also under review: James Clapper, former director of national intelligence; former FBI Director James B. Comey; Bush national security advisor Michael Hayden; former DeputyAttorney General Sally Yates; President Obama’s national security advisor, Susan Rice; current Justice Department official Bruce Ohr; former FBI Deputy Director Andrew McCabe; former FBI agent Peter Strzok; and former FBI attorney Lisa Page.

Comey, Yates, McCabe and Strzok all were fired by Trump. Ohr remains in the government.

Former national security officials often retain clearances to enable them to continue advising the White House and Congress, or to maintain helpful ties to foreign officials.

Brennan’s tenure as CIA director capped a quarter-century career at the agency. He is fluent in Arabic. As Obama’s homeland security adviser, before becoming CIA director, Brennan was central to the months-long covert effort that ended with the killing of al-Qaida leader Osama bin Laden.

Appearing on MSNBC after Trump’s action, Brennan said: “I’ve seen this type of behavior and actions on the part of foreign tyrants and despots and autocrats in my national security career. I never thought I would see it here in the United States.”

In what could have been his final provocation for Trump, late Tuesday on MSNBC, Brennan called Trump “dangerous to our nation” and “the most divisive president we have ever had,” who has “badly sullied the reputation of the office of the presidency.”

Sanders denied that the action against Brennan was retribution or an infringement of his free-speech rights, contending instead that the decision was a matter of protecting classified information.

“The president has a constitutional responsibility to protect classified information,” she said.

Hayden, the former Bush adviser, said in an interview with the Los Angeles Times, “It’s disappointing that the president would do this. I do think he’s trying to change the narrative because it’s not been a really good week so far. Denying someone a clearance because they criticize the president isn’t warranted, although the president has absolute authority to grant or not grant,” he said. “I just think it’s another example of using authority in a way that’s not productive.”

Hayden said that the president’s action against Brennan and the threat to similarly punish him “isn’t going to affect anything I say or do going forward.” Clapper echoed that sentiment on CNN: “If they are saying that the only way I can speak is to be in an adulation mode of this president, I’m sorry, but I do not think I can sign on for that.”

Brennan, who is paid by NBC News to serve as a national security commentator, has written scathing messages on Twitter. His latest tweet, on Tuesday, excoriated Trump for his own tweet that morning dismissing the fired staff member Omarosa Manigault Newman as “that dog.”

As if writing directly to Trump, Brennan wrote: “It’s astounding how often you fail to live up to minimum standards of decency, civility, & probity. Seems like you will never understand what it means to be president, nor what it takes to be a good, decent, & honest person. So disheartening, so dangerous for our Nation.”