President Donald Trump on Tuesday fired FBI Director James Comey after his attorney general and deputy attorney general recommended his removal.

In a signed letter, Trump informed Comey that he was "hereby terminated and removed from office, effective immediately," explaining that he reached the conclusion that Comey is "not able to effectively lead the bureau."

"It is essential that we find new leadership for the FBI that restores public trust and confidence in its vital law enforcement mission," Trump told Comey in the letter. "I wish you the best of luck in your future endeavors."

Trump took to Twitter on Wednesday morning to defend the move.

James Comey will be replaced by someone who will do a far better job, bringing back the spirit and prestige of the FBI. — Donald J. Trump (@realDonaldTrump) May 10, 2017

Comey lost the confidence of almost everyone in Washington, Republican and Democrat alike. When things calm down, they will be thanking me! — Donald J. Trump (@realDonaldTrump) May 10, 2017

White House press secretary Sean Spicer said shortly before 6 p.m. ET on Tuesday that Comey was "notified a short time ago," but declined to say how Comey was notified. Comey's dismissal took effect immediately.

Spicer told reporters that Trump "accepted the recommendation of the deputy attorney general and the attorney general," who both recommended Comey's "dismissal."

"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," Trump said in a statement.

The White House said it will immediately launch the search for a new FBI director.

Comey was appointed FBI director by President Barack Obama in 2013.

In so doing, he elevated a Republican law enforcement veteran who had been critical of the Justice Department under former President George W. Bush to the top domestic investigative and surveillance organization, among the most powerful posts in the world.

In the decades since former FBI Director J Edgar Hoover, the controversial director who brought FBI into the modern era, law enforcement has avoided the appearance of influencing politics the way Hoover did.

But Comey's decision to thrust himself repeatedly into the 2016 election, put him at odds with the FBI's general decision to stay away from the political spotlight.

Comey made the decision in July to go public with his recommendation that the Justice Department not pursue any charges against former Secretary of State Hillary Clinton or her former staffers over her email practices as secretary of state. However, he also took the opportunity to rebuke Clinton at length as being "extremely careless" with sensitive information.

Then-candidate Trump had talked up the investigation until this point, at which time he and his campaign derided Comey for the "political" decision.

Just days away from the election, Comey jumped into the race again. He informed Congress, via letter, that the FBI had re-opened its investigation into Clinton. The decision was made because of its investigation into former Rep. Anthony Weiner, who is married to Clinton confidant Huma Abedin. Comey followed up days later with another letter, informing Congress that the FBI didn't find anything and continued to believe Clinton's practices did not merit the pursuance of any criminal charges.

After Clinton's loss, former President Bill Clinton blamed Comey for it, as have many Clinton staffers, at least in part.

After taking office, Trump met with Comey at the White House.

He offered a cryptic remark to the FBI chief.

"Oh, here's Jim," Trump said in January. "He's become more famous than me."