SAN FRANCISCO — Embattled Contra Costa County Judge Bruce C. Mills, under fire by the state six times since 2001, has been disciplined for the last time.

The state Commission on Judicial Performance announced Tuesday it had censured and barred Mills from ever returning to the bench for three new counts of misconduct, which were found to be true earlier this year.

The commission’s move means Mills, who retired on May 30, cannot serve as a substitute judge or judicial officer anywhere in California. Typically, retired judges can return to the bench when a regular judge goes on vacation or takes a sick leave.

It is the most serious punishment the commission could have meted out to Mills.

In March, a judicial panel found Mills had committed three counts of misconduct in a couple of 2016 cases. In one, Mills jailed a man for 25 days, then revoked his good behavior credits outside of a court hearing. In another case, Mills was found to have had an improper conversation with the prosecutor in a drunken driving trial.

For Mills, it was the sixth discipline he faced since 2001. The most recent came in 2013, when he was found to have improperly interfered with a driving under the influence case involving his son.

“Given (Mills’) extensive history of discipline, the seriousness of the misconduct in the present matter, the judge’s failure to appreciate the impropriety of his conduct and his lack of candor as evidenced by his shifting explanations for his conduct, the commission concluded that there was a strong likelihood that Judge Mills will engage in subsequent misconduct if he were to serve in a judicial capacity in the future,” commissioners wrote in a news release Tuesday.

Mills’ attorney, Janet Everson, said the commission ignored evidence that should have vindicated him.

“This decision is shocking and not supported by the evidence,” she said in a written statement to this newspaper.

Two of the misconduct counts stemmed from Mills’ decision in 2016 to jail San Ramon resident Joseph Sweeney for 25 days over his blog posts that described his long, contentious divorce case. Mills ruled Sweeney’s writings violated a previous judge’s order not to disclose personal details about his ex-wife.

Ironically, Sweeney, a judicial reform advocate, had testified in favor of auditing the Commission on Judicial Performance for being too soft on judges days before he was jailed.

During the sentencing hearing, Mills said Sweeney would get good behavior credits and “only serve half” his sentence, according to the transcript. In California, nonviolent offenders can get their their sentences by up to 50 percent for good behavior.

After Sweeney was transferred to the jail, the Contra Costa County sheriff asked Mills’ court whether good behavior credits applied. According to the Commission on Judicial Performance’s findings, Mills then moved to revoke Sweeney’s good time credits outside of a court hearing.

After Sweeney’s lawyer complained, Mills again changed course and restored the credits. Mills later wrote in a legal brief this was to avoid a legal dogfight, given “Sweeney’s past litigation history of filing appeals, motions, as well as complaints against the (state commission).”

Sweeney, who has spoken publicly against Mills since the retired judge jailed him, said the Commission on Judicial Performance’s decision was good news to him.

“I’m happy that other people won’t have to deal with a judge who acted like the courthouse was a coffee shop and the law was whatever latte he decided to whip up and serve that day,” he said in a written statement to this newspaper.

In 2016, the Contra Costa County District Attorney’s office reviewed Mills’ actions, in response to complaints about the modified sentencing order. The office determined that Mills had a right to “clarify” an order and took no action, a spokesman said at the time. But in its decision this year, the Commission on Judicial Performance ruled that Mills’ actions amounted to changing the sentence, not simply clarifying a mistake.

Mills said in his July disciplinary hearing he was still unsure to this day whether good time credits apply to contempt cases, and that he conferred with Contra Costa County Superior Court Judge John Kennedy about it before making a final decision. But judicial commissioners say he is missing the point.

“It is not his interpretation of the law or his legal ruling that is at issue, it is the fact that he issued an ex parte modification of an order involving a deprivation of liberty without providing the parties an opportunity to be heard,” commissioners wrote in their decision, released Tuesday.

Mills maintained that he had done nothing wrong at his July disciplinary hearing, where he asked commissioners to reverse the three new misconduct findings against him and said the judicial panel that found he’d committed misconduct “got this wrong.”

“I’m puzzled,” Mills said, according to the transcript. “I can’t understand the confusion and the lack of clarity on behalf of the Commission attorney when we have a crystal-clear record.”

Mills also told the panel he had retired, but said that’s because he wanted something new in life, not due to the pending disciplinary action. He could not be reached for comment Tuesday.

Mills was appointed to the bench by Gov. Pete Wilson in 1995.