Nearly two decades after Pennsylvania state regulators let him off the hook, a former pediatrician admitted in court Thursday that he sexually assaulted 31 children, most of them patients.

Dr. Johnnie Barto of Johnstown pleaded guilty to sexually abusing two family members and admitted to sexually assaulting more than two dozen patients.

The abuse spanned decades and typically involved girls and boys between ages 8 and 12, prosecutors said. One of the victims was 2 weeks old. Barto molested children in the exam room at Laurel Pediatric Associates in Cambria County and at local hospitals, according to the Pennsylvania attorney general’s office.

Barto, 71, was arrested in January and charged with groping a 12-year-old girl during an office visit several weeks earlier. Suspecting she might not be alone, the attorney general’s office put out a call for other accusers to come forward — and they did, by the dozen, with claims going back to the late 1980s.

“They came to their pediatrician seeking care. Instead they were victimized by a serial sexual abuser hiding in a doctor’s coat,” Attorney General Josh Shapiro said in a videotaped statement released after Barto’s plea.

“What happened today was good for everybody, because without a public acknowledgement of wrongdoing, there would be no healing,” said Barto’s lawyer, David Weaver. “This way the healing could begin for his family, his victims and for himself.”

The Pennsylvania Board of Medicine had a chance to stop Barto nearly two decades ago, when he faced administrative charges that he sexually assaulted 4-year-old Lee Ann Berkebile and another young patient during office visits. But state regulators threw out the case and allowed him to keep practicing medicine, and Barto went on to molest more than a dozen more young patients, according to prosecutors.

Berkebile, who is now 29, said Thursday she’s gratified that Barto will be held accountable.

“After 20-some years, I’m just glad it’s finally over, and he can’t do it again. He’s a real sicko,” she told The Associated Press. “He just makes me really disgusted.”

The AP does not typically identify people who say they are victims of sexual assault unless they grant permission, as Berkebile has done.