Trump fired Christopher Krebs in a tweet on Tuesday, saying his recent statement defending the security of the election was "highly inaccurate".
The firing of Krebs, a Trump appointee and director of the Cybersecurity and Infrastructure Security Agency, comes as Trump is refusing to recognize the victory of Democratic President-elect Joe Biden and removing high-level officials seen as insufficiently loyal.
He fired Defense Secretary Mark Esper on November 9 in a broader shake-up that put Trump loyalists in senior Pentagon positions.
Krebs, a former Microsoft executive, ran the agency, known as CISA, from its creation after Russian interference with the 2016 election through the November election.
He won bipartisan praise as CISA co-ordinated federal state and local efforts to defend electoral systems from foreign or domestic interference.
In recent days, Krebs has repeatedly pushed back against false claims that the election was tainted.
Earlier on Tuesday, he tweeted out a report citing 59 election security experts saying there was no credible evidence of computer fraud in the 2020 election outcome.
Trump fired back on Twitter later in the day. He repeated unsubstantiated claims about the vote and wrote "effective immediately, Chris Krebs has been terminated as Director of the Cybersecurity and Infrastructure Security Agency".
Officials with CISA and its parent agency, the Department of Homeland Security, had no immediate comment.
Krebs kept a low profile even as he voiced confidence before the November vote and, afterward, knocked down allegations that the count was tainted by fraud. At times, he seemed to be directly repudiating Trump.
CISA works with the state and local officials who run US elections as well as private companies that supply voting equipment to address cybersecurity and other threats while monitoring balloting and tabulation from a control room at its headquarters near Washington.
It also works with industry and utilities to protect the nation's industrial base and power grid from threats.