A former New Jersey high school teacher who was charged with having sex with six of her students on school grounds has pleaded guilty on the eve of her criminal trial.

Nicole DuFault, 40, entered a guilty plea on three counts of aggravated criminal sexual contact Wednesday, as jury selection was underway, agreeing to register as a sex offender, give up her government employment and teaching licenses.

The language arts teacher was originally accused of having sex with six male students, ages 14 and 15, from Columbia High School in 2013 and 2014 and later blamed it on a brain disorder.

As part of the deal with the Essex County prosecutor's office, she agreed to be on parole supervision for life and is expected to be handed a sentence of five years in New Jersey State Prison on June 8.

Nicole DuFault, 40, entered a guilty plea on three counts of aggravated criminal sexual contact Wednesday

The language arts teacher was originally accused of having sex with six male students, ages 14 and 15, from Columbia High School in 2013 and 2014 and later blamed it on a brain disorder. She is pictured during a court appearance in 2016

Assistant Prosecutor Eric Plant said: 'We believe this is an appropriate resolution.'

Dufault was arrested in 2014 for having sex with the boys she taught in Maplewood.

Her defense since then has been that she has a brain injury which made her powerless to stop their advances and that they were the ones who initiated the indecent relationships.

Her contact with the boys was separate, repeated and on at least one occasion, one watched as she performed oral sex on another and filmed it with his cell phone.

As the single mother-of-two awaited trial, the boys' parents filed legal action against her.

Some demanded up to $1million from her and the school district which they say put their sons at risk by allowing her access to some of the areas on campus where some of the incidents happened during a summer program.

The language arts teacher was originally accused of having sex with six male students, ages 14 and 15, from Columbia High School in 2013 and 2014

In one case, the parents of two underage boys banded together to file a lawsuit against Dufault and the school district in September 2016.

They asked for $1million plus lawyers' fees to compensate the boys who they say were 'intellectually disabled' and 'vulnerable'.

In one of the lawsuits, they describe how Dufault allegedly invited the boys to spend time in her classroom during free periods.

The second was filed by the parents of a former student who was a freshman when he had sex with Dufault in 2014.

In one of the suits, the parents' lawyer described how she 'spoke with them about lewd and sexual actions, brushed up again their bodies and touched intimate and personal parts of their bodies in front of other students in the social group.'

They say she had sex with the boys on campus and in her car.

Some say she sometimes altered their records to allow them to skip class and not get into trouble.

She's expected to be handed a sentence of five years in New Jersey State Prison on June 8

The third lawsuit, filed on behalf of another boy, was lodged in October this year.

It claims that he had sex with Dufault in her car in the high school parking lot. He has not specified how much he wishes to receive.

Dufault's lawyer Tim Smith previously told Tap Into: 'You had a particularly overly aggressive group of students who came into contact with a teacher who suffered from brain damage.'

He did admit there were areas of the school where the incidents took place that were open to them and appeared to try to blame the school for the incidents themselves, claiming they never screened Dufault after a brain surgery.

'You had a program that took place in an isolated part of the school where there was nobody there to control the situation, then you couple that with the fact that the school never screened her post-brain surgery.

'She also had a home front situation that was troubled with her husband having been arrested and she was taking care of the kids herself.

'You had a whirlwind of events that led to this victimization of her,' he added.

A school spokesperson previously said the allegations against Dufault were 'disturbing'.

'The nature of the charges are the most difficult that schools, parents and children would ever have to discuss together,' the spokesman added.

They declined to discuss the matter of the lawsuits.

'By law, administrators and Board of Education members are not permitted to publicly discuss personnel or individual student matters, ongoing litigation, or other issues requiring confidentiality.

'However, we can affirm we believe deeply in our mission to provide our students with a safe and healthy learning environment.

'We are hopeful that the process will bring closure to this painful chapter in our community’s history,' the spokesperson added.