A substitute teacher accused of having sex with a student is blaming education officials for her illegal indiscretions — claiming they failed to stop her, and “allowed” the relationship to blossom.

In a series of interviews with reporters in Iowa, 24-year-old Mary Beth Haglin admitted to having sex with a 17-year-old boy for much of the 2015-16 academic year — and accused Cedar Rapids Community School District of complicity.

“These people all knew what was going on, and yet they turned a blind eye because they wanted to protect their school. They didn’t want it to get into the limelight,” Haglin told KGAN-TV, saying she first had sex with the boy last October. “They allowed this to happen. They knew in February.”

Haglin, a sub at George Washington HS, was arrested on Friday and booked for sexual exploitation of a minor.

She faces up to two years behind bars and having to register as a sex offender for 10 years.

School district officials claim they didn’t act faster against Haglin, citing miscommunication with a local agency that provides substitute teachers.

Haglin – released from jail on Saturday and ordered to steer clear of her 17-year-old victim – said school officials didn’t want to know what was going on.

“They didn’t ban me,” Haglin told the Cedar Rapids Gazette. “They never actually said they were banning me from school grounds, they never said they were banning me from working at any other school, they never said they were banning me from thus-and-so many feet of any school. They never said any of that.”

Haglin waffled between blaming school officials and herself for the ugly mess.

“I do take responsibility,” Haglin told KCRG. “I’m not shying away from this. I’m facing this head on.”

She added: “I no longer have a desire or wish to contact or see this person ever again. And I don’t want him to contact me.”

Haglin’s next court appearances are a preliminary hearing set for August 12th and an arraignment on September 1st.

There’s more female teachers sleeping with their students than you thought: