Updated

President Trump’s seemingly abrupt decision Tuesday to fire FBI Director James Comey was made at the recommendation of top Justice Department officials who claimed that his controversial handling of the Hillary Clinton email case last year rendered him unfit for the position.

A senior White House official told Fox News it was purely “coincidental” that the firing occurred on the same day Comey faced scrutiny for giving faulty testimony about emails sent from Clinton aide Huma Abedin to Anthony Weiner.

Rather, Comey had been the subject of a review by the very top of the Trump Justice Department. Newly confirmed Deputy Attorney General Rod Rosenstein penned an extensive memo for Attorney General Jeff Sessions outlining concerns with Comey’s conduct during and after the Clinton email probe.

The memo said “almost everyone agrees that the Director made serious mistakes.” Rosenstein wrote that he could not defend Comey’s handling of the end of the investigation, and could not understand “his refusal to accept the nearly universal judgment that he was mistaken.”

The first count against Comey, according to Rosenstein, was his July 5, 2016 announcement during which he alleged Clinton and her colleagues were “extremely careless” in handling classified material on her personal email and server but also said the FBI would not recommend charges.

The memo said Comey was “wrong to usurp” then-Attorney General Loretta Lynch’s authority.

“It is not the function of the Director to make such an announcement,” Rosenstein wrote, adding that Comey “at most” should have said the FBI had finished its investigation and presented findings to prosecutors.

The memo said Comey compounded “the error” by holding a press conference to “release derogatory information about the subject of a declined criminal investigation,” suggesting he did so “gratuitously.”

The memo said: “The Director laid out his version of the facts for the news media as if it were a closing argument, but without a trial.” Rosenstein called it a “textbook example” of what prosecutors and agents are “taught not to do.”

The second count against Comey concerned his Oct. 28, 2016 notification to Congress that the bureau was taking another look at the Clinton case in light of newly discovered emails. While Comey has said he did not want to conceal information, Rosenstein said simply refraining from publicizing “non-public information” would not have been concealment.

He countered Comey’s position by citing numerous former Justice officials who called the move inappropriate.

Comey adamantly defended his handling of the case, and that October letter, at a Senate hearing last week.

As referenced by Rosenstein, he said, “Concealment in my view would have been catastrophic.”

Clinton herself has continued to criticize Comey, suggesting his announcement helped tilt the election toward President Trump.

“It makes me mildly nauseous to think that we might have had some impact” on the election, Comey said at the hearing, standing by his actions.

Rosenstein referenced Comey’s statements since the election in his memo’s conclusion: “The way the Director handled the conclusion of the email investigation was wrong. As a result, the FBI is unlikely to regain public and congressional trust until it has a Director who understands the gravity of the mistakes and pledges never to repeat them. Having refused to admit his errors, the Director cannot be expected to implement the necessary corrective actions.”

The memo set off a quick chain reaction all the way up to the White House.

Sessions told Trump that a “fresh start” is needed, attaching the Rosenstein memo and recommending Comey’s removal.

Trump cited that recommendation in his letter to Comey, informing him he is “hereby terminated and removed from office, effective immediately.”

Former FBI spokesperson John Iannarelli told Fox News he thinks Comey got “bad counsel from those close to him,” and that in the end, Comey was perceived as “too political.”

Iannarelli told Fox News the firing was virtually "unprecedented," aside from William Sessions being dismissed by then-President Bill Clinton in the early 1990s.

Fox News’ Serafin Gomez, Brooke Singman and John Roberts contributed to this report.