A woman teacher at a private all girls' school had sex with a pupil during a forbidden love affair.
Games teacher Emily Fox, 26, and the teenage girl, kissed intimately and fondled each other as their secret relationship became more intense.
St Albans Crown Court was told that, as their feelings grew for each other, the pair exchanged lurid emails, text messages and WhatsApp communications.
The court was told it was when the girl, who was a pupil at the Royal Masonic School for Girls in Rickmansworth, Herts., tried to print out an email on her home computer, that the affair was discovered by her parents.
The printer jammed and, a week later, while using it, the girl's father suddenly saw a printed email detailing what had been going on between the pupil and her teacher.
He alerted his wife who, in turn, contacted the school, and the police were called in.
Today Miss Fox, of Alfred Street, Bath, pleaded guilty before Judge Stephen Gullick to four counts of sexual activity with a child by a person in a position of trust.
Sally Mealing-McLeod, prosecuting, said Fox and the teenager had become friends in 2012 and that remained the case from November of that year through to Easter of 2013.
But it was around that time that the teenager declared her love for the teacher, who was 25 years old at the time, and who was in her first post as a teacher.
Miss Mealing-McLeod said that following the Easter holidays, the pair's friendship had become more intense, with them watching television and eating together.
Later on, she said it became more 'sexual.' There was kissing and intimate touching between them.
The prosecutor said that hundreds of lurid emails, text messages and WhatsApp messages flowed between them, in which they spoke about their feelings for one another, recounting their times spent with one another and what they had done together.
Miss Mealing-McLeod went on "Clearly the defendant knew if the relationship became known, it would ruin her career. Both knew that what was taking place was wrong."
The court heard that in 2012 Fox had been spoken to by her head teacher about inappropriate friendships with some of the pupils. She was shown the staff code of conduct and underwent training to help her form appropriate relationships with her pupils.
Dee Connelly, defending, said that it was while studying to be a teacher that her parents had emigrated to the US and Fox had become depressed as she felt more and more isolated.
A suicide attempt had followed at the end of 2011, said Miss Connelly, with Fox taking an overdose.
Explaining the relationship, Miss Connelly told the court: "It was clearly wrong and Miss Fox knows that. It should have stopped and it didn't. But we have seen in these courts a larger disparity in ages."
She described the victim as intelligent and "socially well integrated."
The court was told Fox was terrified of going to prison and had lost her cherished career that she had worked so hard for.
In addition, said Miss Connelly, her reputation was "in tatters."
The court was told Fox is presently still on anti-depressants and, for the last year since her arrest in September 2013, had waited with "trepidation" for the matter to be dealt with.