WASHINGTON — In deciding to abruptly fire FBI Director James Comey, President Trump characteristically let himself be guided by his own instincts – fueled by his creeping anger and sense of victimhood about a probe into Russian meddling in the 2016 election that he considers a “witch hunt.”

The aftermath is a presidency rocked by its most serious self-inflicted crisis yet, exposing dysfunction and distrust within his West Wing and imperiling his agenda. The momentum for the health-care bill that passed the House is gone, and a week scheduled to be devoted to Trump’s preparations for a high-stakes foreign trip was overtaken by distractions and fury.

Across Washington, Trump’s allies have been buzzing about the staff’s competence as well as the president’s state of mind. One Republican figure close to the White House mused privately about whether Trump was “in the grip of some kind of paranoid delusion.”

Trump had been stewing all last week, aggrieved by sharp media scrutiny of his decision to fire Comey and of his and his aides’ ever-shifting explanations, and was quick to blame his staff, according to people who have spoken with him.

Privately, Trump has lashed out at the communications office – led by press secretary Sean Spicer and communications director Michael Dubke – and has spoken candidly with advisers about a broad shake-up that could include demotions or dismissals. The president personally has conducted postmortem interviews with aides about the Comey saga, investigating the unending stream of headlines he considers unfairly negative, according to several White House officials who spoke on the condition of anonymity because Trump is cracking down on unauthorized leaks.

“This was the first major crisis or test they’ve had, and it looks like a lot of systems failed,” said Chris Ruddy, a Trump confidant and chief executive of Newsmax.

The system may be failing, but it is Trump picking which buttons to press. The president takes pride in being the ultimate decision-maker. And chaos has been a hallmark of Trump’s enterprises, from his family real estate empire to his presidential campaign, a 16-month venture during which he cycled through three leadership teams.

Inside the White House, there was widespread agreement that Comey had to go. But how and when Trump would fire him – and how it would be rationalized to the public – was the subject of considerable debate.

Vice President Mike Pence, Attorney General Jeff Sessions, senior adviser Jared Kushner, Chief of Staff Reince Priebus and Counsel Donald McGahn were the closest to the president as he weighed his options, according to White House officials.

Would Trump first visit with Comey and ask for his resignation or fire him abruptly?

He decided the latter.

Would Trump slow down the process so that a communications strategy could be crafted, with credible surrogates lined up to defend his decision, or terminate Comey about 24 hours after first telling top aides he wanted it done?

He chose the latter.

Would Trump stick to the agreed-upon explanation for Comey’s ouster or invoke the Russia investigation? And would he be restrained on Twitter, as his advisers have urged, or peck out a provocative salvo at Comey warning of possible “tapes” of their private conversations?

In both cases, Trump again chose the less prudent path.

White House aides have felt bewildered and alarmed by how Trump arrives at his decisions – often on impulse and emotion and sometimes by rejecting the counsel of those around him – and how he then communicates those decisions to his personnel and the public. Trump can be like a pilot opting to fly a plane through turbulence then blaming the flight attendants when the passengers get jittery.

The result is a hardening portrait of sheer disarray.

“The Comey firing is just the most dramatic example of a White House that is completely dysfunctional, the most chaotic in modern history,” said Chris Whipple, author “The Gatekeepers,” a new history of White House chiefs of staff.

“Reince Priebus has made rookie mistake after rookie mistake,” Whipple said. “But ultimately, it’s fundamentally on Donald Trump.

Robert Gates, a former defense secretary who informally advised Trump during the transition, criticized his handling of Comey’s ouster.

“Not terribly well done,” Gates told John Dickerson in a CBS News interview scheduled to air Sunday on “Face the Nation.”

“I fired a lot of senior people myself, and I think the key, when you feel compelled to remove a senior official, is essentially to have all your ducks in a row at the beginning,” he continued. “To have the rationale, have everybody understand what the rationale was. If possible, to be in a position to announce who is going to step in as the interim immediately. And, if possible, to announce who you’re going to nominate to replace that person.”

As Trump’s anger with the Comey fallout boiled over, his aides have been pointing fingers at one other.

Much of the internal blame has fallen to the communications operation, with Kushner and others questioning why the small army of press staffers led by Spicer and Dubke took so long to forcefully defend the president’s decision and agree to talking points that could withstand scrutiny.

Inside the West Wing, it became a running joke among staffers that the answer to every question would be “Rosenstein,” referring to the deputy attorney general, Rod Rosenstein, who wrote a memo outlining a case for Comey’s ouster.

Trump loyalists were particularly upset that Senate Minority Leader Charles Schumer, D-N.Y., organized a news conference Tuesday and got other Democrats to parrot the same message before a full explanation came out of the White House – despite the fact that the White House controlled every variable of the story.

“They were running around like chickens with their heads cut off,” said one White House official.

Yet Trump did not inform Spicer and Dubke of his decision until an hour before it was announced, keeping them and other aides out of the loop because he feared the news might leak prematurely, officials said.

There is confusion about whether Stephen Bannon, the chief strategist who had been somewhat marginalized after feuding last month with Kushner, was among those Trump consulted about his decision.

Some of Trump’s allies said they are worried that the president views the Comey episode entirely as a public-affairs crisis and has not been judicious about protecting himself from legal exposure as the FBI continues to probe possible links between his campaign and Russia.

When Trump sat down for the interview with NBC anchor Lester Holt, he invited potential legal peril by connecting his firing of Comey to the Russia matter.

“In fact, when I decided to just do it, I said to myself, I said, ‘You know, this Russia thing with Trump and Russia is a made-up story, it’s an excuse by the Democrats for having lost an election that they should have won,’ ” Trump told Holt.

Trump also revealed that he had asked Comey on three separate occasions whether he was under investigation by the FBI and said that Comey had told him he was not.

It is Justice Department policy that ongoing investigations generally are not to be discussed with White House officials.

Pollster Patrick Caddell, a longtime confidant of Bannon who served in Jimmy Carter’s White House, said he was pained to watch the Trump White House struggle.

“It’s like reliving the Carter administration on steroids,” Caddell said. “This is an outsider administration being surrounded by Apache knives. “