IN A few short months, interim U.S. attorney Timothy J. Shea, whom Attorney General William P. Barr installed, has presided over two extraordinary retreats from justice, in both cases to help associates of President Trump, and in both cases over the objections of career prosecutors. Such extraordinary malpractice calls out for an extraordinary response. Fortunately, one is at hand.

Mr. Shea’s moves, benefiting Trump ally Roger Stone and former Trump national security adviser Michael Flynn, have elicited an outraged letter from 2,000 former Justice Department officials and the resignation of a career prosecutor. But that is not enough. Mr. Shea’s stint leading the U.S. attorney’s office in the District is up in early June, and Mr. Trump has nominated no one to succeed him. In these circumstances, federal law empowers district court judges to select an interim replacement. In normal times, Washington’s federal judges would likely tap the interim U.S. attorney to stay longer or ask the attorney general for advice on whom to appoint. This time, they should make their own choice, installing someone who will do the job fairly and competently.

Mr. Shea has proved he is not that person. In the Stone case, he revoked a sentencing memorandum prosecutors had submitted, recommending that Mr. Stone receive lighter punishment for obstructing Congress and witness tampering, despite the fact that the prosecutors’ original recommendation was in line with sentencing guidelines.

In the Flynn case, Mr. Shea moved to have charges dropped, even though the former national security adviser had already pleaded guilty to lying to investigators — a plea deal that headed off potential charges on other matters. Justice Department experts and former officials said they had never seen the department make such a retreat, and certainly not on behalf of a presidential favorite.

Each of these decisions is a scandal, and together they put the Justice Department’s legitimacy in more peril than it has been in a generation.

Mr. Barr has insisted that he is righting wrongs and that critics are motivated by partisanship only — and never mind that the wrongs he discovers consistently benefit the president’s friends. Whether Mr. Shea personally supports these actions or is simply willing to follow orders is immaterial; for the judges to ask Mr. Shea to continue in office would be to endorse this perversion of the justice system.

Judges should steer clear of political controversies whenever possible. But Washington’s U.S. attorney’s office should be headed by a conscientious prosecutor with no record of political decisionmaking. Even if it is short-lived, such an appointment would underscore the judiciary’s commitment to the impartial administration of justice.

Read more: