Preet Bharara, a scholar in residence at New York University Law School, was U.S. attorney for the Southern District of New York from 2009 until this March.

The most dramatic hearing I helped to arrange as chief counsel to a Senate subcommittee took place 10 years ago Monday, when James B. Comey, then deputy attorney general in the George W. Bush administration, described how he and FBI Director Robert Mueller intervened at the hospital bedside of Attorney General John Ashcroft.

The encounter occurred in 2004, after White House Chief of Staff Andrew H. Card Jr. and White House Counsel Alberto R. Gonzales tried to overrule Comey’s and Mueller’s legal objection to a secret terrorist surveillance program. When the White House nonetheless sought the ailing Ashcroft’s blessing to proceed, Comey prepared to resign. Ultimately, Comey and Mueller prevailed.

(Jenny Starrs,Julio Negron/The Washington Post)

Jim Comey was once my boss and remains my friend. I know that many people are mad at him. He has at different times become a cause for people’s frustration and anger on both sides of the aisle. Some of those people may have a point. But on this unsettling anniversary of that testimony, I am proud to know a man who had the courage to say no to a president.

And in the tumult of this time, the question whose answer we should perhaps fear the most is the one evoked by that showdown: Are there still public servants who are prepared to say no to the president?

Now, as the country once again wonders whether justice can be nonpolitical and whether its leaders understand the most basic principles of prosecutorial independence and the rule of law, I recall yet another firestorm that erupted 10 years ago over the abrupt and poorly explained firing of top Justice Department officials in the midst of sensitive investigations. The 2007 affair was not Watergate, the more popular parallel invoked lately, but the lessons of that spring, after the Bush administration inexplicably fired more than eight of its own U.S. attorneys, are worth recalling.

When the actions became public, people suspected political interference and obstruction. Democrats were the most vocal, but some Republicans asked questions, too. The uproar intensified as it became clear that the initial explanations were mere pretext, and the White House couldn’t keep its story straight. Public confidence ebbed, and Congress began to investigate.

In response, the Senate launched a bipartisan (yes, bipartisan) investigation into those firings and the politicization of the Justice Department. Early on, the then-deputy attorney general — Comey was gone by then — looked senators in the eye and said the U.S. attorneys were fired for cause; although such appointees certainly serve at will, this assertion turned out to be demonstrably false. We learned that the U.S. attorney in New Mexico, David C. Iglesias, was fired soon after receiving an improper call from Republican Sen. Pete V. Domenici pushing him to bring political corruption cases before the election. We learned that Justice Department officials in Washington had improperly applied a conservative ideological litmus test to attorneys seeking career positions, to immigration judges and even to the hiring of interns.

Ultimately, amid the drumbeat of revelations, every top leader of the department stepped down under a cloud. Finally, Gonzales himself resigned. Strict protocols were put in place severely limiting White House contacts with Justice officials on criminal matters. The blow to the morale and reputation of the department was incalculable.

For me, the past week has been deja vu all over again. To restore faith in the rule of law, three obvious things must happen: First, we need a truly bipartisan investigation in Congress. That means no partisan nonsense — just a commitment to finding the facts, whatever they may be, proving (or disproving) Russian interference in our election and anything related. Congress is a check and a balance, and never more important than when a bullying chief executive used to his own way seems not to remember the co-equal status of the other two branches.

Second, the new FBI director must be apolitical and sensitive to the law-enforcement mission, not someone with a long record of reflexive partisanship or commentary on the very investigative issues that will come before the bureau. Unfortunately, some of the candidates paraded by cameras this past weekend reality-show style fall into that category. I can’t think of anything worse for FBI morale, for truth-finding or for public trust. More than ever the FBI needs a strong and stabilizing hand, which means somebody who has not spent most of his or her career pandering for votes, groveling for cash or putting party over principle.

Finally, I join in the common-sense call for an independent and uncompromised special counsel to oversee the Russia investigation. Given the manner of Comey’s firing and the pretextual reasons proffered for it, there is no other way. My former colleague, now-Deputy Attorney General Rod J. Rosenstein, is a respected career prosecutor but has mostly deserved the doubts he generated with his peculiar press-release-style memo purporting to explain Comey’s sudden sacking. He can still fix it. The move would not only ensure the independence of the investigation, but also provide evidence of Rosenstein’s own independence.

History will judge this moment. It’s not too late to get it right, and justice demands it.