A Kentucky judge who stirred controversy earlier this year by refusing to hear adoption cases involving gay parents says he plans to resign in hopes of quashing an ethics inquiry by a state judicial panel.

Judge W. Mitchell Nance told the Kentucky Judicial Conduct Commission in a memo made public Wednesday that he would resign effective Dec. 16 rather than fight the commission’s charges that he violated ethical rules. He also sent a resignation letter to Kentucky Gov. Matt Bevin (R), the Associated Press reported.

Nance was facing sanctions that included possible removal from the bench.

“Judge Nance must have seen the writing on the wall,” said LGBT advocate Chris Hartman, whose organization, the Fairness Campaign, helped bring a complaint against the judge. “I hope this sends a message to judges across the country that if their conscience conflicts with their duty, they must leave the bench.”

Kentucky law permits same-sex couples to adopt children.

Nance, who handles family cases in Barren and Metcalfe counties, made national headlines in the spring after he issued an order saying that permitting a “practicing homosexual” to adopt would “under no circumstance” promote the child’s best interests.

He tried to disqualify himself from all adoption cases involving gay parents by citing judicial codes that allow judges to recuse themselves from cases over “personal bias or prejudice.” His order stated that attorneys should tell court officials of such cases ahead of time so another judge could hear them. He referred to his stance as “conscientious objection” and “a matter of conscience.”

The move was condemned by an array of legal experts and advocacy groups, including the American Civil Liberties Union, which said his actions made him unfit for office. Several conservative organizations, however, rallied behind him. Among them was the Lexington-based Family Foundation, which argued judges should be given leeway on issues of marriage and sexuality.

The state’s judicial conduct commission later charged Nance with violating rules requiring judges to maintain public confidence and perform their duties impartially.

In a written response this week, Nance and his attorneys waived a hearing before the commission and asked to have the charges dismissed, saying his offer to resign rendered the case moot. But Nance stood by his original recusal plan, arguing that same-sex adoption cases presented him with a “unique crisis of conscience,” as the Glasgow Daily Times reported.

Nance declined to discuss the case with the newspaper but said he would miss being a judge. “It’s a very demanding job,” he said.

When he first drew attention in April, Nance gave no indication that he was considering resignation. He told The Washington Post in a brief interview that his order was “based on the law, based on my conscience” and designed to “minimize any disruption in the litigation.”

The 66-year-old was elected to the bench in 2000 and moved to the 43rd Judicial Circuit’s Family Court in 2004, according to the Glasgow Daily Times.

His attempt to recuse himself drew comparisons to Kim Davis, the county clerk in Kentucky who was jailed for contempt of court in 2015 after she refused to issue marriage licenses to same-sex couples. Judges had penned multiple orders compelling Davis to comply with the U.S. Supreme Court’s landmark ruling that year establishing same-sex marriage as a fundamental right. Davis objected, saying it violated her religious beliefs.

More from Morning Mix:

NBC political analyst Mark Halperin is accused by five women of sexual harassment, CNN reports

Kellogg’s apologizes for lone brown corn pop on cereal box