WASHINGTON — President Donald Trump fired FBI Director James Comey on Tuesday, stunning Washington with a decision that carries vast political ramifications because the FBI is investigating whether anyone close to the president colluded with Russian intelligence agents to influence the 2016 presidential election.

The ouster was needed to allow a “new beginning” at the FBI, Trump said, citing criticism by Deputy Attorney General Rod Rosenstein, a career prosecutor, of Comey's public announcements about his investigations of Hillary Clinton's email practices.

The firing, the first dismissal of an FBI chief since 1993, caught Comey by surprise as he spoke to FBI agents at an event in Los Angeles.

“He was caught flat-footed” when the news flashed on television screens in the room, a senior FBI official told reporters before Comey headed back to Washington. Comey skipped a scheduled event at the Directors Guild aimed at recruiting minority agents.

The dismissal drew immediate calls from senior Democrats for an independent prosecutor to oversee the counterintelligence investigation into Trump associates' ties to Russia, a probe that could lead to criminal charges.

As Trump's political opponents compared the firing to Richard Nixon's dismissal of the Watergate special prosecutor more than four decades ago in the infamous “Saturday Night Massacre, even some members of the president's own party expressed concern.

Sen. Richard Burr, R-N.C., head of the Senate intelligence committee, said he was “troubled by the timing and reasoning” of the dismissal, which he said “further confuses an already difficult investigation.”

Comey's departure, he added, was “a loss for the bureau and the nation.”

Senate Democratic Leader Chuck Schumer of New York said he told Trump, who called to notify him before making the firing public, “You're making a very big mistake.”

Attorney General Jeff Sessions sent an email to FBI employees Tuesday saying that Andrew McCabe would take over as acting director. McCabe, an FBI employee since 1996, was named deputy director in 2016.

He supervised sensitive investigations, including the probe of Clinton's email practices.

McCabe visited the White House on Tuesday night, but officials said he did not meet with Trump.

In statements, leading Democratic lawmakers warned the dismissal could lead to a White House effort to shut down the FBI investigation into potential collusion.

“No one should accept President Trump's absurd justification” for the firing, declared Sen. Patrick Leahy, D-Vt., former head of the Senate Judiciary Committee.

“The president has removed the sitting FBI director in the midst of one of the most critical national security investigations in the history of our country — one that implicates senior officials in the Trump campaign and administration. This is nothing less than Nixonian,” Leahy said.

Although the FBI director serves a fixed term, which is supposed to insulate him from political pressure, previous presidents of both parties have taken the position that as an officer of the executive branch, the director can be fired by the president.

Trump said he had acted on the recommendation of Deputy Attorney General Rod Rosenstein, a career prosecutor who is overseeing the FBI's handling of the Russia investigation because Sessions has stepped aside from any role in it.

In a memorandum to Sessions, which was released by the White House, Rosenstein criticized Comey for his actions last July, when Comey held a news conference to announce that the FBI would not seek charges against Clinton in the email investigation but also denounced her conduct.

That was a serious misjudgment, Rosenstein said, adding, “The goal of a federal criminal investigation is not to announce our thoughts at a press conference.”

Rosenstein said Comey made the problems worse with his decision in late October — in the run-up to the election — to disclose that the FBI had reopened its investigation of Clinton after finding State Department emails on a computer belonging to former Rep. Anthony Weiner, the estranged husband of Clinton's aide, Huma Abedin. After a week, the FBI determined that those emails added no significant new evidence to the case.

Clinton has blamed the Comey letter for contributing to her defeat, although polling evidence is unclear.

Trump praised Comey's announcement at the time.

Comey told the Senate Judiciary Committee last week that the criticism he had received had been “painful.”

“I've gotten all kinds of rocks thrown at me and this has been really hard, but I think I've done the right thing at each turn,” he testified. He added that he welcomed an FBI inspector general's review of his conduct, which was announced in January.

But Comey argued that he had no choice but to disclose the renewed investigation before an election, and not “conceal” it.

Rosenstein disagreed. Prosecutors should never disclose non-public information about investigations, he wrote. “Silence is not concealment.”

A search for a new permanent FBI director will begin immediately, a White House statement said.

Staff writers Noah Bierman, Evan Halper, Lisa Mascaro and Joseph Tanfani contributed.

david.lauter@latimes.com