A Philadelphia teacher who worked at a school for troubled kids has pleaded guilty to a having an affair with a female student.

Nina Scott, 28, accepted a plea deal Monday for sexually assaulting a 16-year-old student whom she referred to as her “girlfriend” while employed at The Village School, news station WCAU reported.

Authorities said that the teen initiated the relationship in February 2016 when she asked Scott in a note, “How would you feel if I kissed you?”

The pair then began an eight-month fling that involved sexual encounters on school property, in Scott’s vehicle and at her home, Philly.com reported.

During the affair, Scott wrote the student more than 30 letters, according to authorities.

Police were notified of the relationship in October after the girl transferred schools and staff found letters and a journal detailing their romance.

Scott, who has a 2-year-old daughter, was fired in December from the school.

She will serve a minimum of three months on electronic home monitoring, which will be followed by five years of sex offender probation, WCAU reported.