REDWOOD CITY — Before one jury can weigh the guilt or innocence of a once-renowned child psychiatrist accused of molesting his young male patients, another will determine if is he is competent for retrial.

Two court-appointed doctors wrote in reports delivered Thursday in San Mateo County Superior Court that William Ayres, 78, is able to aid in his own defense, prosecutor Melissa McKowan said.

In most county cases, these reports end questions on competency. However, defense attorney Jonathan McDougall asked for a full trial on the issue, which is allowed even if doctors have already said someone is competent. The trial is set for Oct. 4, said McKowan.

McDougall did not respond to a request for comment and has declined in the past to discuss the case.

If jurors decide Ayres is competent to stand trial on nine counts of child molestation, which stem from allegations made by men who were under his care as boys, the case will proceed to trial. But if the panel finds he is not able to aid in his defense, Ayres will be treated until doctors decide he is mentally healthy enough for the case to resume.

It's not clear what health problems Ayres may be suffering from because the doctor's records have been sealed by McDougall.

The case against Ayres was put on hold in March when McDougall expressed a doubt about his client's competency. Ayres remains out of custody on $750,000 bail.

If a trial occurs, it will be the second on these same counts for the former doctor. Last summer, jurors deadlocked on all charges, and a mistrial was declared. During the trial, Ayres testified that he gave the boys genital and physical examinations as part of their treatment, saying they were medically necessary.

But some of the former patients testified Ayres had masturbated them during the exams, and others said he had touched them inappropriately. Jurors said they were leaning toward conviction on some counts, and the DA's office decided to retry the case.

The competency trial should last several days and will include testimony from mental-health professionals.

McKowan said it is a needless roadblock.

"Another unnecessary delay that is causing frustration on the part of everyone involved on the prosecution side," she said. "The families (of the accusers) were present again today, and they are mentally exhausted by this process."

McDougall recently asked for a competency trial for another of his high-profile clients.

Alex Youshock, who stands accused of trying to kill staff at Hillsdale High School last summer in a failed bomb attack, is set to have a competency trial in August.

Two of three court-appointed doctors said Youshock was competent to stand trial.