As part of his plea, which was entered in San Mateo County Superior Court in Redwood City this afternoon, Ayres admitted to a number of special allegations attached to the charges.
The plea deal came as jury selection was under way in the courtroom of Judge Beth Freeman for the retrial of Ayres, a former president of the American Academy of Child and Adolescent Psychiatry.
Prosecutors allege Ayres molested multiple male victims who had come to him for counseling. The molestations involved fondling during medical examinations of the boys during counseling sessions, according to the district attorney's office.
Ayres's first trial ended in a hung jury in 2009.