WASHINGTON, DC -- In a move that stunned the nation, President Donald Trump fired FBI Director James Comey on Tuesday.

In a statement, Trump says Comey's firing "will mark a new beginning" for the FBI. The White House says the search for a new FBI director will begin immediately.

Comey's firing comes days after he testified on Capitol Hill about the FBI's investigation into Russia's election meddling and possible connections between Russia and Trump's campaign.

The White House released this statement:

Statement from the Press Secretary

Today, President Donald J. Trump informed FBI Director James Comey that he has been terminated and removed from office. President Trump acted based on the clear recommendations of both Deputy Attorney General Rod Rosenstein and Attorney General Jeff Sessions.

“The FBI is one of our Nation’s most cherished and respected institutions and today will mark a new beginning for our crown jewel of law enforcement,” said President Trump.

A search for a new permanent FBI Director will begin immediately.

"You are hereby terminated and removed from office, effective immediately," Trump told Comey in a personally signed letter obtained by NBC News.

"While I greatly appreciate your informing me, on three 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," the president wrote.

Trump acted "on the clear recommendations of both Deputy Attorney General Rod Rosenstein and Attorney General Jeff Sessions," White House Press Secretary Sean Spicer said in a statement. It said a search for a new FBI director will begin "immediately."

"The FBI is one of our Nation's most cherished and respected institutions and today will mark a new beginning for our crown jewel of law enforcement," the statement quoted Trump as saying.

This is the letter in which FBI Director James Comey was informed of his firing.

The FBI said in a letter to the Senate Judiciary Committee on Tuesday that Comey grossly overstated the number of emails that Clinton aide Huma Abedin forwarded to husband, Anthony Weiner, while working at the State Department.

The White House said the dismissal had already been in the works before the FBI acknowledged Comey's inaccurate testimony. Three senior FBI and Justice Department officials told NBC News that Comey was given no warning in advance.

The firing came just after the FBI confirmed Comey provided erroneous testimony to a Senate panel about how Hillary Clinton aide Huma Abedin handled classified emails.

MORE: Lawmakers react to James Comey's firing

The FBI is currently conducting an investigation into possible collusion between the Trump campaign and Russia during last year's presidential election.

PHOTOS: Documents surrounding James Comey's firing

Comey also has been under fire from Democrats for months over his announcement, less than two weeks before the November election, that the FBI was reopening an e-mail investigation into Clinton.

In his recommendation to Trump, also obtained by NBC News, Rosenstein wrote that Comey mishandled the overall investigation of the email scandal and said he was wrong to have announced last July that the Justice Department's investigation of Clinton's emails was being closed.

Referring to Comey's statement Oct. 28, shortly before Election Day, that more Clinton emails had been found on Weiner's laptop computer — which Clinton has partly blamed for her loss to Trump — Rosenstein wrote: "We do not hold press conferences to release derogatory information about the subject of a declined criminal investigation."

"The FBI Director is never empowered to supplant federal prosecutors and assume command of the Justice Department," he wrote. "The way the Director handled the conclusion of the email investigation was wrong."