“Which office do I go to to get my reputation back?” Those were the bitter words of former labor secretary Raymond J. Donovan after finally being found not guilty at trial two years after he was forced to step down from Ronald Reagan’s cabinet to face fraud and grand larceny charges that turned out to be false.

When prosecutors charge a citizen with having engaged in criminal conduct, there are enormous costs. The accused is branded publicly as a possible felon before family, neighbors and business associates. That person also must obtain counsel, live under a cloud of shame for months or years until the case is resolved and, even if ultimately vindicated, endure thereafter the lingering belief in the minds of many that “where there’s smoke there’s fire.”

Of course, prosecutors are responsible for bringing charges against people who break the law and for prosecuting them once they are charged. And when a person is charged with a crime, key procedural protections are automatically invoked, including the right to due process of law.

What is frightening — and wrong as a matter of ethics and simple decency — is when prosecutors publicly accuse a person without having brought any charge. This is what U.S. Attorney Ronald C. Machen Jr., the chief law enforcement officer for the District, did this month when, following businessman Jeffrey Thompson’s guilty plea to conspiracy to violate federal campaign finance laws, he held a news conference and excoriated Mayor Vincent C. Gray (D).

The American Bar Association’s model ethical rules prohibit prosecutors from “making extrajudicial comments that have a substantial likelihood of heightening public condemnation of the accused . . . except for statements that are necessary to inform the public of the nature and extent of the prosecutor’s action and that serve a legitimate law enforcement purpose.” As a lawyer practicing in the District, Machen is subject to the D.C. Bar’s version of that rule, which includes this instructive comment:

“In the context of a criminal prosecution, pretrial publicity can present the further problem of giving the public the incorrect impression that the accused is guilty before having been proven guilty through the due processes of the law. It is unavoidable, of course, that the publication of an indictment may itself have severe consequences for an accused. What is avoidable, however, is extrajudicial comment by a prosecutor that serves unnecessarily to heighten public condemnation of the accused without a legitimate law enforcement purpose before the criminal process has taken its course. When that occurs, even if the ultimate trial is not prejudiced, the accused may be subjected to unfair and unnecessary condemnation before the trial takes place. Accordingly, a prosecutor should use special care to avoid publicity, such as through televised press conferences, which would unnecessarily heighten condemnation of the accused.”

We are troubled, therefore, by Machen’s lengthy statement at his March 10 news conference. Surrounded by members of his staff and of the FBI and Internal Revenue Service, Machen decried the “sad truth” of “widespread corruption,” that had been “suppressed for far too long.” He then detailed a series of allegedly illegal acts by someone he called “Mayoral Candidate A.” This person is obviously Gray.

In addition to the rules of ethics, the ABA’s Standards for Criminal Justice state: “A prosecutor should not make . . . an extrajudicial statement that a reasonable person would expect to be disseminated by means of public communication, if the prosecutor knows or reasonably should know that it will have a substantial likelihood of prejudicing a criminal proceeding.” Predictably, Machen’s comments were broadcast on pretty much every news station in the District and the broader region. As the standard notes: “The opinion of the lawyer on the guilt of the defendant, the merits of the case, or the merits of the evidence in the case” is “ordinarily likely to have a substantial likelihood of prejudicing a criminal proceeding.”

We take no position on the guilt or innocence of Gray — though even if he is indicted, he is presumed innocent. But if he is indicted, can he receive the due process of a trial by an impartial jury in the District? Ironically, Machen failed to respect the code of ethics that all lawyers must comply with. We expect more from the District’s chief prosecutor.

The writers are law professors, respectively, at Hofstra University School of Law and the Georgetown University Law Center and are co-authors of the book “Understanding Lawyers’ Ethics.”