President Trump stunned the political world by firing FBI Director James Comey on Tuesday, an abrupt ending to a tenure marked by political controversies ranging from Trump's connections to Russia to Hillary Clinton's handling of classified emails.

Trump says he based his decision on the recommendations from both Deputy Attorney General Rod Rosenstein and Attorney General Jeff Sessions.

In a written statement, Trump said that "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 search for a new permanent FBI director will begin immediately, White House spokesman Sean Spicer said.

Trump informed Comey that he was "hereby terminated and removed from office, effective immediately," in a letter released by the White House.

In recommending Comey's firing, the Justice Department leadership excoriated the FBI director for his handling of the investigation into Hillary Clinton's use of a private email server during her time as secretary of State. In his termination letter, Trump agreed Comey was "not able to effectively lead the bureau."

Comey's sudden dismissal calls into question the future of the investigation into Russian hacking of the 2016 presidential election.

The FBI is currently in the midst of a full-blown counterintelligence inquiry, exploring charges of possible collusion between Trump campaign associates and Russian officials.

Trump even referred to the FBI's ongoing investigation in his termination letter — telling Comey he appreciated him "informing me, on three separate occasions, that I am not under investigation."

Yet Democrats — including some who had previously attacked Comey for his handling of the Clinton probe — saw Trump's move as a blatant attempt to short-circuit the Russia investigation.

"This is nothing less than Nixonian," said Sen. Patrick Leahy, D-Vt., a reference to President Richard Nixon's decision in 1973 to remove the Watergate special prosecutor.

And Rep. Adam Schiff of California, the top Democrat on the House Intelligence Committee, said Trump's decision to fire the man overseeing a federal investigation into his campaign associates' collusion with Russia "raises profound questions about whether the White House is brazenly interfering in a criminal matter."

Schiff, whose panel is conducting a separate investigation into Russia's influence on the presidential election, called for an independent prosecutor "to restore a modicum of public confidence — now completely lacking — that the criminal investigation will continue without further interference by the White House."

Senate Intelligence Chairman Richard Burr, R-N.C., who is leading a Senate panel’s investigation into Russia’s election interference, said he was “troubled’’ by both the timing and reasons for Comey’s dismissal.

"I have found Director Comey to be a public servant of the highest order, and his dismissal further confuses an already difficult investigation by the committee,’’ Burr said. “In my interactions with the director and with the bureau under his leadership, he and the FBI have always been straightforward with our committee.

“Director Comey has been more forthcoming with information than any FBI director I can recall in my tenure on the congressional intelligence committees," he continued. "His dismissal, I believe, is a loss for the bureau and the nation.”

A career prosecutor, Comey, held top Justice Department posts in the George W. Bush administration before being appointed FBI director by President Barack Obama in 2013.

He is only the second director fired in the 82-year history of the FBI. President Bill Clinton fired FBI Director William Sessions in 1993 amid ethics problems. While FBI directors are appointed to 10-year terms in order to make them nominally non-partisan, they can still be fired by the president.

As news of Comey's dismissal raced through Washington on Tuesday night, Republicans defended the move was difficult but necessary.

Sen. Chuck Grassley, R-Iowa, chairman of the Senate Judiciary Committee, said Comey's "decisions on controversial matters have prompted concern from across the political spectrum and from career law enforcement experts."

Meanwhile, Comey was apparently finding out his own employment status in an unconventional way.

Comey left Washington earlier Tuesday for a speaking engagement, and was not informed of his firing until he saw news reports of it on television while at the FBI’s Los Angeles field office, a person familiar with the matter said.

The abrupt 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.

Notably, some of the same Democrats upset about Comey's firing have also previously called for his head, blaming her loss of the presidency on Comey's unexpected public announcement on Oct. 28 that he was re-opening the investigation into Clinton's emails.

Rosenstein, confirmed by the Senate two weeks ago as Comey's day-to-day supervisor, also faulted Comey for announcing he had re-opened the case 11 days before the election — and for his earlier July 5 news conference saying no charges would be filed against Clinton.

In a memo to the attorney general, Rosenstein said he did not understand Comey's refusal to acknowledge fault with his actions.

"Almost everyone agrees that the director made serious mistakes; it is one of the few issues that unites people of different perspectives," Rosenstein wrote.

Meanwhile, as Comey remains the target of public criticism over his handling of the Clinton case, the Justice Department’s inspector general is in the midst of wide-ranging review of Justice’s handling of the matter, including Comey’s leadership of it.

Last week, Comey disclosed in testimony before the Senate Judiciary Committee that he had been interviewed by Justice investigators assigned to the case and expected to be questioned again.

“I have a story to tell,’’ Comey told the panel.

Comey, 56, succeeded Robert Mueller, the longest serving FBI director since J. Edgar Hoover. Mueller served for 12 years before leaving the bureau.

A former chief federal prosecutor in Manhattan and former deputy attorney general, Comey won plaudits for his independence as a key player in one of the most dramatic moments during the George W. Bush administration.

With then-Attorney General John Ashcroft hospitalized in 2004 with acute pancreatitis, Deputy Attorney General Comey rushed to his boss’ bedside at George Washington Hospital when he learned that then-White House counsel Alberto Gonzales and White House chief of staff Andrew Card were trying to persuade Ashcroft to reauthorize a controversial warrantless eavesdropping program.

Since taking office, Comey has staked out the highest profile of any director since Hoover.

In any venue, the 6-foot-8-inch Comey is hard to miss. Often referring to himself as an “awkward white guy,’’ he was anything but while delivering testimony before Congress engaging audiences in public and private forums.

Even in high-stakes congressional hearings, Comey often operated without written text and rarely sought advice from aides who accompanied him.

His public and controversial handling of the Hillary Clinton email investigation was only the latest in a string of public positions that the director took that did not always sit well with the White House and the Justice Department — including under Obama's administration.

He bluntly acknowledged law enforcement’s fraught relationship with the racial and ethnic communities in addresses at Georgetown University and in Birmingham, Ala., and has suggested that less-aggressive policing may be contributing to spikes in violent crime in some parts of the country—a position that put him at odds with former Attorney General Loretta Lynch and the Obama White House.

He drew the wrath of the tech industry and privacy advocates last year as the face of the government’s legal battle with Apple Inc., to gain access to the iPhone of San Bernardino terrorist Syed Farook. With Apple insisting that creating a way to break into the device's default encryption would be tantamount to giving the FBI a "backdoor" that could be used to break into Apple products again and again, Comey described the dispute as the “hardest problem I’ve encountered in my entire government career.’’

At another point, Comey acknowledged the vexing nature of battling homegrown violent extremists, ticking off a list of recent bloody assaults and attempted attacks that have scarred communities across the country, from Garland, Texas to Orlando, Fla. His public concern about the FBI's capacity to confront the growing homegrown threat, prompted lawmakers to question whether the bureau had the resources to deal with it.

As the White House searches for a replacement, FBI Agents Association President Thomas O’Connor called on the Trump administration to proceed with “caution."

“A change in FBI leadership of this magnitude must be handled carefully and with an eye towards ensuring that the bureau can continue to fulfill its responsibility to protect the American public from criminal and national security threats,’’ O’Connor said.

“We greatly appreciate Director Comey’s service, leadership, and support for special agents during his tenure. He understood the centrality of the agent to the bureau's mission, recognizing that agents put their lives on the line every day. His focus was to ensure that the bureau’s investigations complied with the law and the constitution, and that agents performed their mission with integrity and professionalism. As vital stakeholders, FBI agents should be given a voice in the process of selecting the next director.”