President Trump on Tuesday night fired his administration’s most senior cybersecurity official responsible for securing the presidential election, Christopher Krebs, who had systematically disputed Mr. Trump’s false declarations in recent days that the presidency was stolen from him through fraudulent ballots and software glitches that changed millions of votes.
The announcement came via Twitter, the same way Mr. Trump fired his defense secretary a week ago and has dismissed other officials throughout his presidency. Mr. Trump seemed set off by a statement released by the Department of Homeland Security late last week, the product of a broad committee overseeing the elections, that declared the 2020 election “the most secure in American history.”
“The recent statement by Chris Krebs on the security of the 2020 Election was highly inaccurate,” Mr. Trump wrote a little after 7 p.m., “in that there were massive improprieties and fraud — including dead people voting, Poll Watchers not allowed into polling locations, ‘glitches’ in the voting machines which changed votes from Trump to Biden, late voting, and many more.” He said Mr. Krebs “has been terminated” as director of the Cybersecurity and Infrastructure Security Agency, a post to which Mr. Trump himself had appointed him.
Mr. Krebs, 43, a former Microsoft executive, has been hailed in recent days for his two years spent preparing the states for the challenges of the vote, hardening systems against Russian interference and setting up a “rumor control” website to guard against disinformation. The foreign interference so many feared never materialized; instead, the disinformation ultimately came from the White House.
The firing stirred an immediate backlash in the national security community and on Capitol Hill.
“Of all the things this president has done, this is the worst,” said Senator Angus King, independent of Maine, who led a commission on improving cyberdefenses. “To strike at the heart of the democratic system is beyond anything we have seen from any politician.”
He said Mr. Krebs was one of the most competent people he had met in the government. “In this administration, the surest way to get fired is to do your job,” Mr. King said.
Senator Richard M. Burr, Republican of North Carolina, issued a statement calling Mr. Krebs “a dedicated public servant who has done a remarkable job during a challenging time.”
“I’m grateful for all Chris has done,” Mr. Burr said.
Only two weeks ago, on Election Day, Mr. Krebs’s boss, Chad F. Wolf, the acting secretary of homeland security, had praised Mr. Krebs’s work, including the “rumor control” effort. But behind-the-scenes efforts by some administration officials to keep Mr. Trump from firing Mr. Krebs apparently failed.
Mr. Krebs started telling colleagues he expected to be fired after the election as early as June, when the president started claiming that mail-in voting would be “rigged.”
The refusal by Mr. Krebs and his agency to back up the president’s claims put him on a list of disloyal officials, Mr. Krebs believed, that included Mark T. Esper, who was fired as secretary of defense shortly after the election; Christopher A. Wray, the F.B.I. director; and Gina Haspel, the director of the C.I.A. Mr. Wray and Ms. Haspel remain in their jobs.
In recent weeks, Mr. Krebs drew the president’s ire again with his refusal to echo Mr. Trump’s conspiracy theories about software glitches and dead people voting. Quite the contrary: Within hours of Mr. Trump tweeting false reports that millions of Trump votes were deleted, Mr. Krebs joined election officials in calling the election “the most secure in American history.”
As of Tuesday, he was still scheduling public speaking engagements on behalf of his agency. On Wednesday, he was due to participate in two, including a fireside chat on “Foreign Interference and Election Meddling.”
Mr. Krebs did not immediately respond to requests for comment. But after his termination, he tweeted from his personal account: “Honored to serve. We did it right. Defend Today, Secure Tomrorow. #Protect2020.”
Alexei Woltornist, a spokesman for the Department of Homeland Security, said the agency had nothing to add to the president’s tweet.
Mr. Krebs had told friends he was planning to leave government after Mr. Trump’s term. Mr. Krebs has five young children and was running one of the fastest-growing agencies in the federal government, with a broad mandate to secure power plants, water systems and networks that were subject to relentless cyberattacks by criminals and foreign states. Until recently, members of the Trump administration often cited the agency’s progress and its innovations, as did some prominent Democrats. Last week, a parade of Silicon Valley executives praised his work in securing the election.
The day before the election, he had given briefings every few hours, describing how the usual tribulations of the day were being dealt with, and squelching rumors. “It’s just another Tuesday on the internet,” he said with a shrug when asked about some of the misinformation.
Many in the administration believed that Mr. Trump, while angered, would not actually fire him — it would only highlight how the president’s claims were being contradicted by his own department.
And Mr. Krebs himself kept turning out announcements over the weekend, including a brief celebration of the second anniversary of his agency: He included a photograph of homeland security officials, himself included, crowded behind Mr. Trump’s desk as he signed legislation.
Michael Chertoff, the former homeland security secretary under President George W. Bush and a Republican, called the firing of Mr. Krebs “nothing more than Trump’s personal vindictiveness.”
“He’s done everything you would want a senior official at D.H.S. to do,” Mr. Chertoff said. “As far as I’m concerned, this firing is a badge of honor for Chris Krebs.”
Even if he were invited to return in President-elect Joseph R. Biden Jr.’s administration, Mr. Krebs has told colleagues he would most likely demur. Not out of politics, but because, he said, he enjoyed the freedom of public speaking and engaging with the news media and feared that Mr. Biden’s administration, like President Barack Obama’s before it, would keep a tighter lid on officials.
Before he was fired Tuesday, Mr. Krebs managed to engage with the public once more, firing off a pointed retweet aimed at the president: “Please don’t retweet wild and baseless claims about voting machines, even if they’re made by the president,” said the original tweet from David Becker, an election expert. “These fantasies have been debunked many times.”
Julian Barnes and Zolan Kanno-Youngs contributed reporting.