She was a 24-year-old substitute teacher.

He was a 17-year-old high school student.

And over the course of an illicit, months-long relationship during the 2015-2016 school year in Cedar Rapids, she admits, the pair had sex “hundreds of times.”

Mary Beth Haglin was charged in July with sexual exploitation by a teacher.

But now, Haglin claims that not only is she innocent of committing any crime, she’s actually the victim in the relationship.

Haglin appeared on the Dr. Phil show this week and accused the student of hatching an elaborate plan of romantic seduction, then threatening to “burn her life down” if she ended the relationship.

In recent months, Haglin claims, she’s been fired from her job and forced to work as a stripper using the nom de stage “Bambi.”

“The student twisted my brain into accepting this relationship,” she told Dr. Phil McGraw. “He did so with such intelligence and such an elevated vocabulary that I was completely duped by the whole facade.”

“Many people see him as the victim and me as the perpetrator,” she added. “From a psychological standpoint and from every other standpoint, I feel like I am the victim.

“He did burn my life to the ground.”

Haglin’s trial is scheduled to begin Nov. 14, but she has requested that it be relocated due to the publicity surrounding the case, according to The Associated Press.

The Cedar Rapids Community School District has banned Haglin from employment in the district, but she continued to work as an elementary school substitute teacher near the end of the last school year “because of a miscommunication,” The Associated Press reported.

A spokesperson said the district formally removed Haglin from its “substitute central system” on June 14.

The former substitute teacher told Inside Edition in September that her tryst with her student started when he began writing flirtatious messages on Post-it notes that he left on her desk on his way out of class at Washington High School. The student began asking her to get lunch or coffee, she said on Dr. Phil; she initially resisted his overtures, she said, but the pair began texting and chatting on Facebook in September 2015.

At the time, she was 23 and the student was 17.

“Trust me, it’s not difficult to be a caring boyfriend,” the student texted Haglin, according to a message revealed by the show. “Especially to someone as magnificent as you.”

Haglin told Inside Edition the student even had pet names for his teacher, including “my empress” and “Mrs. Robinson,” a reference to Anne Bancroft’s classic movie role as an older woman who embarks upon an affair with a younger man in The Graduate movie.

Over time, Haglin said, the teen’s romantic gestures softened her resolve, and a sexual relationship began last October.

She was attracted to him, she told McGraw, because of “his mind,” which she described as more mature than his age.

“I was completely head over heels,” she told Inside Edition.

She said she met the teen nearly every day to have sex in her car, which she parked in a public park. They also visited his parents’ homes, she told Dr. Phil.

“We met several times a week, not every time was just to have sex,” she said. “There were times we would sit and talk. I thought in my mind this was some sort of real relationship.”

Loading... Loading... Loading... Loading... Loading... Loading...

In Iowa, teachers are prohibited from sexual contact with students until 30 days after graduation, even if the student is at least 18, according to the Des Moines Register.

As their relationship progressed, Haglin said, she eventually sent the student naked pictures, which he shared with other teenagers. Haglin told McGraw that she never expected the student to share the images.

“You have got to be dumber than a box of rocks to share naked pictures with a 17-year-old boy,” the talk-show host said.

“He knew that I was vulnerable,” Haglin responded.

The relationship eventually unravelled when the teacher and student were spotted by other students in a car in June. One witnesses took video of the couple and posted it on Twitter, the Des Moines Register reported.

Haglin told McGraw that when the student began telling his classmates that he was carrying on an inappropriate relationship with her, she tried to break up with him.

At that point, she said, he threatened to tell school officials about the relationship and “light a match and burn down [her] life.”

Haglin said she was too scared to end the relationship, but a parent eventually convinced her to confess and shared that confession with school officials, who launched an investigation.

According to the Des Moines Register, Washington High School’s veteran principal, Ralph Plagman, “was asked to resign after the district determined he had participated in an ineffective initial investigation into accusations about Haglin’s conduct.”

The Gazette of Cedar Rapids reported that “though Plagman and other administrators investigated rumors of Haglin’s inappropriate relationship in February and again in May, no one in the district ever contacted police, district officials have said.”

Haglin told the Gazette that the district wanted to keep her conduct “hush-hush.”

“The Cedar Rapids Community School District has concluded its investigation into the events related to Mary Beth Haglin’s inappropriate relationship with a student during the spring 2016 semester at Washington High School,” a district statement said. “Under Iowa’s public records laws, the District is required to keep its investigation, and certain student information and personnel information confidential.”

Unable to find a teaching job and needing income, Haglin told Dr. Phil that she has been forced to take a job as a stripper.

“You could wind up having to register as a sex offender for probably 10 years,” McGraw told her. “You need to seriously step back and assess all of the bad decisions that have snowballed here because you are very young and you can so turn this around.”

“This does not have to ruin your life,” he added, before promising to help her find a counsellor and a different job.