A former Florida middle school teacher has pleaded guilty to having sex with a 14-year-old student and sending him nude pictures.

Stephanie Peterson, 27, pleaded guilty as part of a plea deal to one count of lewd or lascivious battery sex act with a child and one count of transmission of harmful material to minors by electronic means. Both are felonies.

Peterson will face a minimum of five years and a maximum of 10 years in prison when she is sentenced.

The former New Smyrna Beach Middle School science teacher was arrested in February after the 14-year-old told his parents about their relationship.

Former Florida middle school teacher Stephanie Peterson, 27, has pleaded guilty to having sex with a 14-year-old student and sending him nude pictures

He confessed to his parents that Peterson would pick him up from their home at 11pm and that they often spent hours together at her home while her firefighter husband was at work.

The teen claimed he had sex with Peterson in her house and car as well as a barn behind his own house from November 2017 to January 2018.

He also revealed that Peterson had sent him nude photographs of herself and that she bought him marijuana and a 'bowl to smoke it' in.

The teen reportedly told his parents that his relationship with the teacher was hurting his grades.

Snapchat messages between Peterson and the teen were released by the State Attorney's Office earlier this month.

The messages show Peterson panicking after finding out that the teen's mother knew about them and was planning to go to the police.

Peterson (pictured in court in March) pleaded guilty to lewd or lascivious battery sex act with a child and transmission of harmful material to minors by electronic means

Peterson (pictured in March) will face a minimum of five years and a maximum of 10 years in prison when she is sentenced

'So she's planning on doing something with it,' Peterson messaged the student.

'I hate you,' she added. 'So much.'

Peterson then told the teen to tell his mother that it was the 'worst decision of my life'.

'I know it was and idk where my brain was but I somehow fell in love with you briefly and idk why [sic].'

'I'll never been the same person because of it.'

Peterson then asked the teen if she should call his mom, before begging him to 'delete everything'.

The former middle school teacher had originally planned to enter a no contest plea in court on Tuesday, according to Daytona Beach News-Journal.

But Judge Raul Zambrano said he did not accept no contest pleas in sex cases.

The former New Smyrna Beach Middle School science teacher was arrested in February after the 14-year-old told his parents about their relationship

The teen said he had sex with Peterson in her home while her now ex-husband (pictured together) was at work. They also had sex in her car and in a barn behind the teen's home

'The component of any sentence is treatment, and a component of treatment is admitting that you did what you did,' he told Peterson.

'If you plead no contest here, they go to treatment and they don't want to admit anything.'

Peterson then talked to her attorney for a minute before telling the judge without hesitation that she would be pleading guilty.

She also told Zambrano that she was taking 'psychotropic medication' as prescribed.

'Do you have a clear understanding of what's happening here?' Zambrano then asked her.

'Yes, sir,' she replied.

He then asked Peterson to describe in her own words what she was doing in the courtroom.

'Uh, pleading guilty to those two counts,' she replied.

The teen also revealed that Peterson had sent him nude photographs of herself and that she bought him marijuana and a 'bowl to smoke it' in

As part of the plea deal, prosecutors dropped a second count of lewd or lascivious battery sex act with a child, but Peterson will be required to register as a sex offender.

A sentencing date has not yet been set.

Peterson's defense team plans to ask the judge for a downward departure from the minimum sentence, meaning they will argue she should get less than five years in prison.

The former teacher was accompanied by her father and several others in the courtroom.

She divorced from her husband of two years, DeLand firefighter Brandon Ferri, a month after her arrest.

Peterson's victim was not in court but some of his family members attended.