A former Downingtown police officer assigned to a high school in the borough has been sentenced to two years’ probation for having a physical relationship with a 17-year-old boy she met at the school.

Stefanie Dunne, 44, of Thornton, pleaded guilty Tuesday to corruption of a minor, court records show. Chester County Judge Jacqueline C. Cody sentenced Dunne to probation and ordered her to stay away from the teen, as well as all other minors except her children.

Dunne’s attorney, Caroline Donato, said Thursday that she believed the resolution of the case “was fair and made in the general interest of justice.” Assistant District Attorney Emily Ruth Provencher, the lead prosecutor, declined to comment.

Dunne was arrested in May, when an officer found her and the teen in a state of undress in the back of Dunne’s vehicle, parked in a secluded area of a park in Downingtown, according to the affidavit of probable cause for her arrest.

Detectives searching Dunne’s cellphone recovered more than 6,000 text messages between the two, conversations that included sexual innuendo and terms of endearment, the affidavit said. She was fired from the department shortly after her arrest.

It was unclear when their physical relationship began, but investigators said there was no evidence that it had started while the teen was enrolled at Downingtown West High School. Additionally, he was above the legal age of consent in Pennsylvania when the physical contact occurred, so Dunne was not charged with any sexually based offenses.

Former First Assistant District Attorney Michael Noone, then the lead prosecutor on the case, called their relationship “inappropriate” and admonished Dunne for abusing her authority.

“This was a situation where this defendant had a responsibility to take care of students, to protect students,” Noone said at the time. “And instead, she betrayed her oath, she betrayed her badge, and she took advantage of this young man."

In interviews with investigators, Dunne said she met the teen as a freshman at Downingtown West, where she was assigned as a school resource officer. She said that she saw the teen as a “tortured soul” and that their initial conversations were spent with her trying to coach him out of a “downward spiral," according to court documents.