William Barr was U.S. attorney general from 1991 to 1993.

Having served as both attorney general and deputy attorney general in the Justice Department, I had responsibility for supervising the FBI, working on virtually a daily basis with its senior leadership. From that experience I came to understand how fortunate we are as a nation to have in the FBI the finest law-enforcement organization in the world — one that is thoroughly professional and free of partisanship. I offer this perspective on President Trump’s removal of FBI Director James B.Comey.

Comey is an extraordinarily gifted man who has contributed much during his many years of public service. Unfortunately, beginning in July, when he announced the outcome of the FBI investigation into Hillary Clinton’s use of a private email server while secretary of state, he crossed a line that is fundamental to the allocation of authority in the Justice Department.

While the FBI carries out investigative work, the responsibility for supervising, directing and ultimately determining the resolution of investigations is solely the province of the JusticeDepartment’s prosecutors. With an investigation as sensitive as the one involving Clinton, the ultimate decision-making is reserved to the attorney general or, when the attorney general is recused, the deputy attorney general. By unilaterally announcing his conclusions regarding how the matter should be resolved, Comey arrogated the attorney general’s authority to himself.

[William Barr: Trump was right to fire Sally Yates]

It is true, as I pointed out in a Post op-ed in October, that Attorney General Loretta E. Lynch, after her tarmac meeting with Bill Clinton, had left a vacuum by neither formally recusing herself nor exercising supervision over the case. But the remedy for that was for Comey to present his factual findings to the deputy attorney general, not to exercise the prosecutorial power himself on a matter of such grave importance.

Until Comey’s testimony last week, I had assumed that Lynch had authorized Comey to act unilaterally. It is now clear that the department’s leadership was sandbagged. I know of no former senior Justice Department official — Democrat or Republican — who does not view Comey’s conduct in July to have been a grave usurpation of authority.

Comey’s basic misjudgment boxed him in, compelling him to take increasingly controversial actions giving the impression that the FBI was enmeshed in politics. Once Comey staked out a position in July, he had no choice on the near-eve of the election but to reopen the investigation when new evidence materialized. Regrettably, however, this performance made Comey himself the issue, placing him on center stage in public political discourse and causing him to lose credibility on both sides of the aisle. It was widely recognized that Comey’s job was in jeopardy regardless of who won the election.

It is not surprising that Trump would be inclined to make a fresh start at the bureau and would consult with the leadership of the Justice Department about whether Comey should remain. Those deliberations could not begin in earnest until the new deputy attorney general, Rod J. Rosenstein, to whom Comey would report, was confirmed and in a position to assess Comey and his performance. No matter how far along the president was in his own thinking, Rosenstein’s assessment is cogent and vindicates the president’s decision.

Rosenstein made clear in his memorandum that he was concerned not so much with Comey’s past arrogation of power, as astonishing as it was, but rather with his ongoing refusal to acknowledge his errors. I do not dispute that Comey sincerely believes he acted properly in the best interests of the country. But at the same time, I think it is quite understandable that the administration would not want an FBI director who did not recognize established limits on his powers.

It is telling that none of the president’s critics are challenging the decision on the merits. None argue that Comey’s performance warranted keeping him on as director. Instead, they are attacking the president’s motives, claiming the president acted to neuter the investigation into Russia’s role in the election.

The notion that the integrity of this investigation depends on Comey’s presence just does not hold water. Contrary to the critics’ talking points, Comey was not “in charge” of the investigation.

In the Justice Department, responsibility for overseeing and directing investigations is lodged in the department’s prosecutors. Because Attorney General Jeff Sessions has recused himself, the investigation into Russian interference is being supervised by Rosenstein and Dana Boente, acting head of the department’s National Security Division. Both men have long and exemplary service as career prosecutors in the department and were selected to hold political office as U.S. attorneys by President Barack Obama.

In short, responsibility for the integrity of the Russia investigation is vested in the hands of two highly regarded Obama veterans. Senate Democrats were well aware that Rosenstein would be overseeing the Russia investigation when they overwhelmingly joined with Republican senators in confirming him by a 94-to-6 vote.

Furthermore, the day-to-day work in that investigation was being done not by Comey but by career prosecutors and FBI agents, whose professionalism and integrity do not depend on the identity of the FBI director. Indeed, as the acting director, Andrew McCabe, just testified, FBI agents working on the investigation will do a thorough and professional job regardless of who is serving as the bureau’s director.

According to news reports, the investigation is in full swing, with the Justice Department using a grand jury to subpoena relevant information, indicating a degree of thoroughness not evident in the investigation into Clinton’s email server. Comey’s removal simply has no relevance to the integrity of the Russian investigation as it moves ahead.