President Donald Trump fired FBI Director James Comey on Tuesday over his handling of the investigation into Hillary Clinton’s emails, the White House said.

“Today, President Donald J. Trump informed FBI Director James Comey that he has been terminated and removed from office,” White House press secretary Sean Spicer wrote in a statement (which appears below).

The statement went on to say that a search for a new FBI director will begin “immediately.”

Also Read: James Comey Says He's 'Mildly Nauseous' Over Potentially Swaying Election

Trump’s decision was based on the recommendation of both Attorney General Jeff Sessions and Deputy Attorney General Rod Rosenstein, according to Spicer.

In a separate letter (below), Trump wrote: “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.”

Despite what the president wrote, he is in fact under investigation. Comey has been investigating Russia’s meddling in the 2016 election potential collusions with the Trump campaign.

“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,” Trump went on to say in his letter to Comey. “I wish you the best of luck in your endeavors.”

Also Read: FBI Chief James Comey Tried to Expose Russian Interference in NYT Op-Ed, Obama Said No

The move came as a surprise to members of the bureau. Officials at the F.B.I. told the New York Times they were not immediately aware of Comey’s dismissal.

Memos released by the White House show deputy attorney general Rod Rosenstein said he couldn’t defend Comey’s handling of the investigation into Hillary Clinton’s emails.

Trump has criticized Comey’s handling of the Clinton investigation in the past.

“FBI Director Comey was the best thing that ever happened to Hillary Clinton in that he gave her a free pass for many bad deeds! The phony Trump/Russia story was an excuse used by the Democrats as justification for losing the election. Perhaps Trump just ran a great campaign?” Trump tweeted on May 2.