The White House did not respond to questions about the former officials’ criticism of the president, but Mr. Trump’s outrage spoke for itself. He kept lobbing tweet-size insults until Sunday morning, when he left the White House for a round of golf.

In one, he took aim at news that Mr. McCabe, who was one of the first officials at the F.B.I. to look into possible Russian ties to the Trump team, had kept contemporaneous memos about his interactions with the president. (Mr. Comey also kept memos.)

“Spent very little time with Andrew McCabe, but he never took notes when he was with me,” Mr. Trump wrote. “I don’t believe he made memos except to help his own agenda, probably at a later date. Same with lying James Comey. Can we call them Fake Memos?”

Jeremy Bash, who served as chief of staff to Leon E. Panetta in his roles as C.I.A. director and defense secretary during the Obama administration, said in an interview that current and former officials were alarmed to see a president so intent on eroding the public’s trust in the F.B.I. They are keenly aware, Mr. Bash said, that Mr. Trump’s insults have a way of making it to TV, and vice versa.

“It seems to be a very short distance between the president’s Twitter device and the megaphone of Fox News and other allies on Capitol Hill,” Mr. Bash said. “I think most professionals I speak with think he will ultimately fail, but they worry we are a few Fox News segments away from more and more people in that conspiracy theory echo chamber.”

Some experts question the decision of Mr. Comey and others to publicly hit back at the president. Mike German, a former F.B.I. agent who is now at the Brennan Center, a public policy and law institute, said the public exchanges were further proof of an eroding of trust between the head of the executive branch and its traditionally apolitical civil servants.

He said the former officials’ willingness to speak out against the president could spell problems for Mr. Mueller.