WASHINGTON — President Trump on Tuesday fired the director of the F.B.I., James B. Comey, abruptly terminating the top official leading a 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 a special counsel 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 his “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.