An Arkansas judge has resigned after a state commission accused him of ordering male defendants to be spanked, engage in sex acts and bend over for thousands of photographs to fulfill their “community service,” a senior state official said on Tuesday.

The resignation of the district court judge, O. Joseph Boeckmann Jr., was effective immediately after it was sent to the State Judicial Discipline and Disability Commission on Monday, said David J. Sachar, the commission’s executive director.

The commission, which investigates judges over possible misconduct or for disabilities that prevent them from doing their jobs, began an inquiry into Judge Boeckmann in 2014 over a possible conflict of interest in an unrelated case on elder care, Mr. Sachar said. But that case took a surprising turn when court employees began asking investigators, Did you hear about the boys?

“Then the dam broke,” Mr. Sachar said.

As of Tuesday, no criminal charges had been filed, but Mr. Sachar said they were possible.