A pregnant Australian teacher will give birth behind bars, as the 34-year-old was sentenced to 15 months in prison for her sexual interactions with a 17-year-old male student at Sydney Grammar School, ABC News reported. The two had sexual contact several times in a three month period, which left the victim emotionally worse for wear, according to court testimony.

The teacher and the student, neither of whom were named in any news reporting, began texting each other in 2015. According to the ABC News report, there were at least 5 sexual encounters, even in classrooms, in the aforementioned three months in 2016. The teacher was reportedly warned multiple times that she should not develop close relationships with her students.

Terms like “emotional blackmail” were used to describe the teacher’s relationship to the student, who tried to end the relationship multiple times before it finally happened. The teacher offloaded her marital problems onto the student and even indicated she would inflict self-harm if the relationship ended.

She told the student’s parents that he was a “delight to teach,” according to news.com.au.

In coming up with a sentence for her crimes, the judge did note that her poor mental health likely contributed to the situation. When her relationship with the student began, she had suffered three miscarriages and had a rocky relationship with her husband. The baby she is carrying belongs to her husband, not the student.

The teacher received a 15-month sentence, but will be eligible in September, after seven months. That means she will have to give birth to her child while in prison, regardless of when she is released.

GettyImages-110904708 The Sydney Skyline is seen before the lights are switched off for Earth Hour on March 26, 2011 in Sydney, Australia. Photo: Lisa Maree Williams/Getty Images