A Napa County judge will resign at the end of the year under terms of an agreement reached with state disciplinarians who accused him of stealing, and later returning, two pricey business-card holders from a San Francisco social club.

Superior Court Judge Michael Williams was also censured by the Commission on Judicial Performance and agreed to never seek judicial office again, according to the stipulation made public on Monday.

“Judge Williams’s conduct seriously undermines public confidence in the integrity of the judiciary,” the commission wrote. “The judge’s agreement to resign effective December 5, 2017, and not to seek or hold judicial office thereafter affords protection to the public and the reputation of the judiciary in the most expeditious manner by avoiding the delay of further proceedings.”

Williams was already planning to retire, and the agreement with the commission “allowed him to bring closure to the event,” said the judge’s attorney, Edith Matthai of Robie & Matthai in Los Angeles. “He regrets terribly that he did this.”

Williams did not immediately respond to a message left for him at the Napa courthouse Monday morning. The judge told the Napa Valley Register in June he was “deeply disappointed in myself and … profoundly embarrassed.”

The commission accused Williams of pocketing an art deco-style card holder belonging to The City Club of San Francisco as he was leaving an American Academy of Matrimonial Lawyers dinner there on March 9, 2016. The judge left “and then returned and took one or two more [card holders] before taking an elevator down to the first floor,” according to the commission.The holders contained cards with the names of the club’s managers.

Each card holder was worth between $30 and $50, the commission said, making Williams’ alleged actions potentially chargeable as petty theft.

On March 28, 2016, a member of the AAML told Williams he had been spotted on video taking the card holders. The next day the judge sent a package to The City Club containing the holders and an apology letter that said, “I have no excuse but I had a couple of glasses of wine and was not thinking of what I was doing,” the commission said.

Williams reported to the commission two days later what happened, blaming his actions on an “unexplainable impulse” to use the holders to display decades-old “joke” business cards he had recently rediscovered.

The commission in June initiated formal proceedings against Williams, an action typically reserved for the most serious charges facing a judge.

Gov. Jerry Brown appointed Williams to the Napa court in 2012. He had previously served as a court commissioner there for 11 years.