Madeline Marx, a former substitute teacher in Ohio who pleaded guilty to having sex with students avoids jail time

A substitute high school teacher in Ohio will not be serving time behind bars after pleading guilty to having sex with two of her students.

Madeline Marx pleaded guilty in March to two counts of sexual battery involving students while she was a teacher at Kettering Fairmont High School. Her lawyer initially tried to enter a plea of not guilty by insanity.

She was pulled from her classroom and arrested in November after police started investigating the teacher when student went to administration saying she was having inappropriate relationships with students.

Prosecutors said her victims were both 16-year-old boys.

On Thursday, a Montgomery County pleas court judge sentenced the 24-year-old former educator but opted out of giving her jail time.

Marx (pictured on the left in court on Thursday) broke down in tears as she apologized to the victims' families

Marx, pictured at that hearing in December, was teaching at Kettering Fairmont High School when she was arrested for sexual battery involving students

Instead, Marx was sentenced to five years probation for both sexual battery counts, ABC 22 reports.

Marx broke down in tears during her sentencing apologizing to the victims' families.

'I cannot express how sorry I am for what I've done to the victims and their families,' she told the judge. 'I'm so sorry.'

Judge Steven Danok thanked Marx saying the former teacher hadn't been in trouble with the law before and cooperated with authorities once she was caught, according to ABC.

He also said that he had received 38 letters of support for Marx and the parents of one of the victims asked that she be given probation.

'The court believes these offenses are not likely to recur,' Dankof said. 'This is extremely significant to the court, that Ms. Marx has shown genuine remorse for the offense.'

'We want you to be successful on probation, we want you to be successful on community control,' he told Marx.

Prosecutors said the victims were both 16-year-old boys at Kettering Fairmont High School. Marx is now a tier III sex offender and must register her address every three months

Montgomery County Assistant Prosecutor Dylan Smearcheck said he was pleased with the sentence Marx received.

'Because Ms Marx plead guilty in this case, the victims were spared reliving this through a trial,' he said. 'Additionally Ms Marx is going to have to register for the rest of her life as a sex offender and will never be able to teach again.'

Marx is now a tier III sex offender and must register her address every three months. If she violates her probation she can be thrown in jail.