ITHACA, N.Y. — Former Cayuga Heights Elementary School teacher Ryan Harrington was sentenced after being convicted of inappropriate criminal behavior with a child for several months in 2015.

Harrington pleaded guilty to endangering the welfare of a child on Jan. 25. He was sentenced on April 14 to three years of probation and a full stay-away order bars him from contacting the child and all immediate family members for three years. Harrington was also forced to give up his teaching certificate and agree to never reapply.

Harrington had an inappropriate criminal relationship with a young child, describing to him how to masturbate, discussing erections in a crowded school lobby, and showing the child how to use a firefighter pager for sexual gratification, among other instances.

During the sentencing, about three dozen people filed into the Ithaca city courtroom to stand in support of the child and the child’s family members.

Judge Scott Miller said, “This court was hesitant to accept the agreement of the parties in this case. The overriding factor was the wishes of your son to be able to move on with his childhood, and I hope he’s able to do that.”

If the case had gone to trial, Miller said a recorded two-hour conversation between the child’s mother and Harrington, where he confessed to his actions, would have been evidence for a jury. And if the jury had found him guilty, Miller said the court would have imposed a sentence of incarceration.

Related: Former Cayuga Heights teacher pleads guilty to having inappropriate sexual conversations with child

Prosecutor Diane Lama read a statement to the court from the child’s mother, detailing the importance Harrington played in their family’s lives and how traumatic the man’s betrayal was to them.

“He was at the hospital the days my children were born. I thought he would be by our side at their graduations and weddings. I felt grateful that he was such an important part of our village, so lucky to have a friend that became family,” Lama read.

The mother wrote that before these crimes,  if Harrington had been accused of wrongdoing, she would have been the first in line to defend him. She would have stood up for him as a longtime friend, beloved teacher and volunteer firefighter at the Cayuga Heights Fire Department.

“That’s who he wanted us to see,” Lama read on behalf of the mother. “It has been nearly impossible to reconcile the person my husband and I thought he was with the person we now know him to be. And it has been heartbreaking to try to accept that the Ryan we knew and loved is the same person who abused our child, deceived us, and dragged us through more than a year of hellish legal proceedings.”

The mother went on to say that she is an overprotective mother, so much so that Harrington would sometimes make fun of her for being too overprotective and distrustful.

“Of all the things I worried about, I  never worried that I would have to keep my children safe from Ryan,” she wrote.

After her child told her about what Harrington did, she said she contacted the police and her child gave police and a CPS worker a statement of what happened to him, telling a consistent and clear narrative.

Then, the mother worked with police to record a controlled phone call with Harrington, when officials say he confessed to his actions. The ensuing legal battle against him went on for nearly two years.

“As we continue to struggle in the present, we are faced with processing more than a decade of a shared past. Now, Ryan’s presence in our past is a deep and hideous stain that we can’t make sense of, much less rid ourselves of. I find myself wanting a do-over, wishing my fmaily could go back in time and recreate all of our family memories without Ryan so we could somehow restore their purity…I fond myself tormented, wondering at what point this really began. How many years had Ryan planned for this relationship with (redacted) to head down this path? How could Ryan have abused (Redacted), had such inappropriate interactions with (redacted), only to come to our house moments later and spend hours looking us in the eye, chatting and laughing with us, pretending that nothing happened? How does anyone make sense of this kind of calculated manipulation and betrayal? I suppose the answer is that we never will,” the mother wrote.

In addition to the sentence, the family is also seeking restitution for therapy for the child and lost wages.

Judge Miller told the mother in court, “I detect some self-doubt on your part about your abilities as a mother, and right now ma’am, I want to tell you there can’t be a parent who is more vigilant than you…you recognized all the signs (of abuse).”

“Do not doubt yourself. You protected your son, and this could have been a much worse situation, and I credit you. You are clearly a wonderful mother, and you saved your little boy from something that could have been much more horrible — because of your vigilance,” he said.

Harrington declined to make a comment in court.