President Trump on Tuesday fired the director of the F.B.I., James B. Comey, abruptly terminating the law enforcement official leading a wide-ranging criminal investigation into whether Mr. Trump’s advisers colluded with the Russian government to steer the outcome of the 2016 presidential election.
The stunning development in Mr. Trump’s presidency raised the specter of political interference by a sitting president into an existing investigation by the nation’s leading law enforcement agency. It immediately ignited Democratic calls for an independent prosecutor to lead the Russia inquiry.
Mr. Trump explained the firing by citing Mr. Comey’s handling of the investigation into Hillary Clinton’s use of a private email server, even though the president was widely seen to have benefited politically from that inquiry and had once praised Mr. Comey for having “guts” in his pursuit of Mrs. Clinton during the campaign.
But in his letter to Mr. Comey, released to reporters by the White House, the president betrayed his focus on the continuing inquiry into Russia and his aides.
“While I greatly appreciate you informing me, on three separate occasions, that I am not under investigation, I nevertheless concur with the judgment of the Department of Justice that you are not able to effectively lead the bureau,” Mr. Trump said in a letter to Mr. Comey dated Tuesday.
The White House said Attorney General Jeff Sessions and the deputy attorney general, Rod J. Rosenstein, pushed for Mr. Comey’s dismissal.
“I cannot defend the director’s handling of the conclusion of the investigation of Secretary Clinton’s emails,” Mr. Rosenstein wrote in a letter that was released by the White House, “and I do not understand his refusal to accept the nearly universal judgment that he was mistaken.”
Reaction in Washington was swift and fierce. In a call with Mr. Trump, Senator Chuck Schumer, the Democratic leader, told the president he was making a big mistake; publicly, Mr. Schumer called the firing a cover-up. Many Republicans assailed the president for making a rash decision that could have deep implications for their party.
Mr. Comey, who is three years into a 10-year term at the helm of the F.B.I., learned from news reports that he had been fired while addressing bureau employees in Los Angeles. While Mr. Comey spoke, television screens in the background began flashing the news. In response to the reports, Mr. Comey laughed, saying that he thought it was a fairly funny prank.
But shortly after, Mr. Trump’s letter was delivered to F.B.I. Headquarters in Washington.
The sudden dismissal of one of Washington’s most prominent officials added to the sense of chaos in a White House that has been roiled by controversy, dogged by scandal and engaged in a furious fight with adversaries.
Mr. Trump had already fired his acting attorney general for insubordination and his national security adviser for lying to the vice president about contacts with Russians. But firing Mr. Comey raises much deeper questions about the independence of the F.B.I. and the future of its investigations under Mr. Trump.
F.B.I. officers were enraged by the firing and worried openly that Mr. Trump would appoint someone seen as a White House ally. Mr. Comey was widely liked in the F.B.I., even by those who criticized his handling of the Clinton investigation, and officers regarded him as a good manager and an independent leader.
Mr. Comey was on Capitol Hill last week when he offered his first public explanation of his handling of the Clinton email case. He said he had no regrets about the decisions he made, but said he felt “mildly nauseous” that his actions might have tipped the election to Mr. Trump.
Last July, Mr. Comey broke with longstanding tradition and policies by publicly discussing the Clinton case and chastising her “careless” handling of classified information. Then, in the campaign’s final days, Mr. Comey announced that the F.B.I. was reopening the investigation, a move that earned him widespread criticism.
Yet many of the facts cited as evidence for Mr. Comey’s dismissal were well known when Mr. Trump kept him on the job: Mr. Comey was three years in to a 10-year term. And both Mr. Trump and his attorney general, Jeff Sessions, had praised Mr. Comey back then for reopening the Clinton investigation by saying his public announcement “took guts.” On Tuesday, that action was at the heart of Mr. Comey’s firing.
“It is essential that we find new leadership for the F.B.I. that restores public trust and confidence in its vital law enforcement mission,” Mr. Trump wrote.
Officials at the F.B.I. said they learned through news reports of Mr. Comey’s dismissal, which Mr. Trump described as effective immediately. The president has the authority to fire the F.B.I. director for any reason.
Under the F.B.I.’s normal rules of succession, Mr. Comey’s deputy, Andrew G. McCabe, a career F.B.I. officer, becomes acting director. The White House said the search for a director will begin immediately.
The firing puts Democrats in a difficult position. Many had hoped that Mrs. Clinton would fire Mr. Comey soon after taking office, and blamed him for costing her the election. But under Mr. Trump, the outspoken and independent-minded Mr. Comey was seen as an important check on the new administration.
“Any attempt to stop or undermine this F.B.I. investigation would raise grave constitutional issues,” said Senator Richard J. Durbin, Democrat of Illinois. “We await clarification by the White House as soon as possible as to whether this investigation will continue and whether it will have a credible lead so that we know that it’ll have a just outcome.”
Senator Roy Blunt, Republican of Missouri, praised Mr. Comey’s service but said new leadership at the F.B.I. “will restore confidence in the organization.”
“Many, including myself, have questioned his actions more than once over the last year,” Mr. Blunt, who sits on the Senate Intelligence Committee, said in a statement.
Mr. Trump’s decision to fire Mr. Comey marks the second time since taking office that the president has fired a top law enforcement official. In early February, Mr. Trump fired Sally Q. Yates, who had worked in the Obama administration but was serving as acting attorney general.
But the president’s firing of Mr. Comey was far more consequential. Ms. Yates was a holdover, and would have served in the Trump administration for only a matter of days or weeks.
A longtime prosecutor who served as the deputy attorney general during the George W. Bush administration, Mr. Comey came into office in 2013 with widespread bipartisan support. He has essentially been in a public feud with Mr. Trump since long before the presidential election.
In a Twitter message this week, Mr. Trump accused Mr. Comey of being “the best thing that ever happened to Hillary Clinton,” accusing him of giving her “a free pass for many bad deeds.”
Senator Ron Wyden, Democrat of Oregon and a member of the Senate Intelligence Committee, said in a post on Twitter that Mr. Comey “should be immediately called to testify in an open hearing about the status of Russia/Trump investigation at the time he was fired.”
Sean Spicer, the White House press secretary, offered a veiled hint of the bombshell earlier in the day on Tuesday, though no reporters picked up on it.
During his daily briefing, Mr. Spicer was asked — as he frequently is — whether Mr. Comey still has the confidence of the president. Instead of saying yes, Mr. Spicer danced around the question.
“I have no reason to believe — I haven’t asked him,” Mr. Spicer said. “I have not asked the president since the last time we spoke about this.”
A reporter noted that Mr. Spicer had previously indicated that the president did have confidence in Mr. Comey, but asked whether recent revelations about Mr. Comey’s misstatement during testimony on Capitol Hill would change that.
“In light of what you’re telling me, I don’t want to start speaking on behalf of the president without speaking to him first,” Mr. Spicer said.
The president’s decision to fire Mr. Comey appeared to be the culmination of the bad will between the men that intensified in early March, when the president posted Twitter messages accusing former President Barack Obama of wiretapping his office.
The next morning, word spread quickly that Mr. Comey wanted the Justice Department to issue a statement saying that he had no evidence to support the president’s accusation. The department did not issue such a statement.
For weeks after, Mr. Trump insisted that his accusation was correct. In dramatic testimony later in March, Mr. Comey said that he had no information to back up the president’s allegations.
That set up a remarkable dynamic — an F.B.I. director directly contradicting a sitting president at the same time that the bureau was pursuing a possible criminal investigation into the president’s aides.