Judge Lynn N. Hughes (U.S. District Court)

Buried in a footnote, the brief rebuke nonetheless marked a notable step in abridging gender discrimination in the legal workplace: The U.S. Court of Appeals for the 5th Circuit scolded a veteran judge for making sexist comments in his Houston courtroom, calling his remarks “demeaning, inappropriate, and beneath the dignity” of his profession.

U.S. District Judge Lynn N. Hughes had been presiding over a criminal case against Simone Swenson, an adoption agency owner charged with fraud.

Under federal rules, prosecutors are permitted to wait until just before trial to turn over pieces of evidence, known as discovery. But when a female federal prosecutor delivered stacks of new documents during four pretrial conferences in early 2017 — weeks after the final discovery date set by Hughes — the septuagenarian judge was not impressed.

“You’re supposed to know what you’re doing,” Hughes said to an assistant U.S. attorney on Feb. 6, 2017. “What else is out there that you misplaced or didn’t think was relevant so you didn’t check it at all?”

Hughes dismissed the Swenson indictment, faulting the prosecutor’s mistakes.

Then he said something else that eventually became the basis of the rebuke.

“It was a lot simpler when you guys wore dark suits, white shirts and navy ties,” Hughes said, according to the 5th Circuit. “We didn’t let girls do it in the old days.”

The U.S. attorney’s office appealed the case’s dismissal, which set up a panel of appellate judges to send back its censorious response.

In reinstating the Swenson case, the appellate court also took an unusual action: It ordered Hughes, now 76, to be replaced with a different judge.

More than a third of the 300,000 members of the American Bar Association are women, according to a recent report from the ABA’s Commission on Women in the Profession, and female litigators have been subjected to male colleagues’ sexist comments for decades.

Two years ago, the ABA adopted an anti-discrimination resolution in its rules of professional ethics, making harassment and discrimination grounds for findings of misconduct.

“It’s important to set up a process and culture that doesn’t marginalize people who legitimately say, ‘You did this to me,’ ” said Michele Coleman Mayes, former chair of the ABA’s Commission on Women in the Profession.

The resolution and the subsequent arrival of the #MeToo movement eased the way for women to come forward with claims of sexual harassment or unfair treatment, Angela Brandt, president of the National Association of Women Lawyers, told The Washington Post. Still, she said, female lawyers are hesitant to do so.

“It’s a male-dominated profession,” she said. “Women feel weak highlighting this type of bad behavior, and, in certain circumstances, it can jeopardize their careers.”

Experts say the industry has therefore faced less scrutiny than other professions — though there have been notable exceptions: Judge Alex Kozinski, for example, resigned from the federal bench last year amid allegations of sexual misconduct. The accusations led to a review of how the judiciary handles claims of harassment, though Kozinski’s abrupt retirement cut short any investigation into the merits of the allegations against him.

Hughes, who has been on the bench for almost three decades, denied the accusation of sexism. He told The Post that his comment was not directed at the prosecutor in his Houston courtroom but at an “inappropriately dressed” woman.

The 5th Circuit acknowledged that Hughes’s comments may have been intended for someone other than the U.S. attorney. Nevertheless, Judge Edith Brown Clement of the 5th Circuit wrote, as Hughes “excoriated the prosecution,” he “attributed the government’s mistakes to the prosecutor’s sex.”

The female prosecutor was not named in the 5th Circuit’s decision, but Assistant U.S. Attorney Tina Ansari has been prosecuting the Swenson case since 2015, according to the Justice Department.

Ansari, who attended the University of Houston Law Center and has been practicing for more than 15 years, could not be reached for comment.

Michael Sokolow, Swenson’s assistant federal public defender, declined to speak about the case, which is being assigned to a new judge and rescheduled for trial.

Hughes denied favoring either sex. “After I’ve made it through my career with a woman’s first name, of course I’m going to be sympathetic,” he told The Post.

Hughes began teaching at South Texas College of Law in 1973. At that time, he said, about 6 percent of the law school’s students were women. By 1985, the figure had surpassed 40 percent, leading to what Hughes called “a vast improvement in the quality of the lawyers. We’re getting the best of both sexes instead of the best of one sex.”

Until recently, there was little judicial precedent or federal case law addressing sexism, California attorney Lori Rifkin told The Post. The Hughes decision, she said, will help female lawyers  represent the best interests of their clients, which should never be reduced by the biases of parties involved in the litigation process.

“It’s very positive that a court of appeals was willing to engage on this issue, name it and act to address the problem,” said Rifkin, who said she had been a victim of belittling, gendered remarks. “Having something so head-on will empower women and other underrepresented groups in litigation to fight back against this kind of treatment.”

In 2016, Rifkin moved for sanctions against her opposing counsel, a managing partner at a California law firm. A comment from him — not to raise her voice at him during a deposition because it’s “not becoming of a woman” — brought on a tongue-lashing from a federal judge, who called it an “indefensible attack on opposing counsel.”

The judge then ordered that he donate $250 to the Women Lawyers Association of Los Angeles Foundation.

There is not necessarily less sexism in the profession now, Rifkin said, but there is “more consciousness and a willingness especially by judges to take a role in addressing it.” Now, she noted, women are doing more than whispering to one another in courthouse hallways. The conversation is happening inside the courtroom.

Still, until there are more women in positions of power in the legal industry, women who practice law will be reluctant to speak out unless the behavior was egregious, said Mayes, who led the ABA’s Commission on Women in the Profession until 2017.

“You win the fight, but you lose the war,” she said. “And I don’t think most people are willing to lose for the cause.”