A special education teacher who pleaded guilty to having a sexual relationship with her 14-year-old student appeared in court and blamed her actions on a drug habit.

Stephanie Amato, 33, who taught at the Ethan Allen Elementary School in Philadelphia, Pennsylvania, was sentenced to serve 11.5 to 23 months in county prison on Tuesday and ordered to register as a convicted sex offender,Philly.com reported.

Amato, the mother of a seven-month-old son, started using prescription opiods before started snorting heroin every day, her attorney said in court.

The 33-year-old apologized to both her family and the student, saying: 'I truly feel that I do not believe this would have occurred if it were not for drugs.'

Stephanie Amato, (above) who taught at the Ethan Allen Elementary School in Philadelphia, Pennsylvania, pleaded guilty to having a sexual relationship with her 14-year-old student

Allegations against Amato were first made 2014, and she was removed from the classroom pending an investigation.

The boy's father told Action News at the time: 'I was very upset. She took my kid's youth and I really want justice to take care of this woman.'

The father also said his son 'felt humiliated' and refused to go to school, adding: 'Since that happened he changed.'

Before Amato handed herself in to authorities in June 2014, she posted images on Facebook, showing herself hanging out with her students.

Several boys in her car posed with their middle fingers up in one photo, while she captioned another: ''My fav students!!'

Assistant District Attorney Kelly Harrell argued for a sentence of five to 10 years in court, saying Amato's relationship had a negative effect on the victim, who is now in juvenile custody after committing a felony.

Harrell said the two had vaginal and oral sex over the course of a few months, and DNA tests confirmed the sexual encounters occurred in her car and at her home, according to Harrell.

The prosecutor also argued that Amato chose her special education student because she thought she could get away with it, and pointed to messages warning the boy: 'You know I can get arrested if you tell'.

Amato, who turned herself in in June 2014, now faces up to 23 months of jail time and has to register as a sex offender. Pictured, a Facebook photo which Amato captioned: 'Fun with these kids!'

Amato appeared in court and blamed her behavior on her use of heroin and prescription opioids. But a prosecutor said she chose her student thinking she could get away with it. Pictured, another of her Facebook photos captioned: 'My fav students!!'

But the teacher sat in court on Tuesday and blamed her drug habit, which began in 2010 when she started taking prescription opioid narcotics recreationally.

She underwent treatment in 2013 and 2014, and relapsed both times, her attorney said. By the time she was arrested, Amato was snorting heroin every day.

But Common Pleas Court Judge Jeffrey P. Minehart said: 'I know drugs were involved, and that affects everything, but I understand that it’s not controlling of this behavior.'

He issued a county prison sentence, explaining that it was her first offense before citing the 33 letters of support submitted from Amato's family and friend.

Amato will also be put on 10 years of reporting probation and barred from contacting juveniles. She'll also have to register her address and report herself four times a year as a convicted sex offender.