A New Jersey high school teacher busted for having sexual relations with six male students pleaded guilty Thursday to three counts of criminal sexual contact, a report said.

Nicole Dufault, 40, who was indicted by a grand jury in February 2015, reached a plea deal with Essex County prosecutors just as her trial was beginning, according to NorthJersey.com.

The former Columbia High School language arts teacher was arrested in September 2014 for the alleged trysts with students, ages 14 and 15, authorities have said.

Dufault had sex with the students on “multiple occasions” from 2013 to 2014 on school grounds, Essex County prosecutors have alleged.

Prosecutors have also said Dufault was caught on tape performing oral sex on one of her victims while another teenage boy was nearby.

Dufault is scheduled to be sentenced June 8, the report said.

As per the plea deal, she must register as a sex offender and give up her teaching license.