A former Montgomery County school employee was sentenced to five years of supervised probation Wednesday for grabbing the buttocks of two teenage students and exposing his buttocks to a third.

Aaron LaMere, 41, also was ordered to complete at least 18 months of “psychosexual” therapy as part of his sentence.

LaMere worked as a media-services technician at Northwood High School in Silver Spring. He resigned in 2012, a short time before he was arrested in the case, according to court records.

In April, he pleaded guilty to one count of fourth-degree sex offense and one count of indecent exposure. As part of the plea agreement, prosecutors did not seek any incarceration. LaMere had been on an electronic-monitoring program.

In court Wednesday, Assistant State’s Attorney Amanda Michalski said LaMere also communicated inappropriately with students.

“Mr. LaMere took advantage of the position that he was in, in terms of authority. And he, with all of these youth, danced the line. And he knew and engaged with them in a lot of sexual discussions. He would text-message them and Facebook-message them and use other media resources to engage in sexual discussions.”

LaMere also spoke at the hearing in Rockville, choking up at times. “Instead of acting like an adult mentor that I should have been, I was acting like a high school student in being one of them.”

Montgomery Circuit Court Judge David A. Boynton countered those remarks. “Your issue, or your problem, was not that you became their friend. It’s that you crossed the line and became sexually interested in these boys.”

LaMere’s attorney, Barry Helfand, said he intends to return to court after LaMere completes his sex therapy and ask that the conviction be expunged. That would allow LaMere to be removed from the Maryland Sex Offender Registry. “While he’s on the registry, it will be hell to pay,” Helfand said, “and he’ll have to endure that.”