This week’s twentysomething female substitute high school teacher who blames the local school district for keeping her on to teach classes after rumors spread that she was having a bunch of sex with a 17-year-old male is Mary Beth Haglin.

Haglin, 24, is a former long-term substitute teacher with the Cedar Rapids Community School District in Cedar Rapids, Iowa. She was arrested on Friday, reports local CBS affiliate KGAN-TV. (She turned herself in.)

Her substitute gigs during the 2015-2016 academic year were mainly at Washington High School. It was at Washington High — the oldest high school in Cedar Rapids — that Haglin allegedly began the relationship with her 17-year-old paramour. He was not a student in any of her classes, she says.

The sexual relationship between Haglin and the male student allegedly began as early as October. The lengthy fling lasted until sometime last month, according to local NBC affiliate KWWL.

Rumors concerning the affair were rampant around Washington High.

School officials briefly investigated in February but, investigators said, they couldn’t find enough evidence.

“At that time I denied everything,” Haglin told The Cedar Rapids Gazette this week. “Well, I didn’t really have a chance to deny much because they basically did all the talking.”

The unidentified student also denied everything in February.

In April, someone posted a video on Twitter showing Haglin and the teen together outside a Smokin’ Joe’s Tobacco and Liquor Outlet — a small chain of sin stores with 16 locations across Iowa.

Lots of students saw that video. Students in Haglin’s classes interrupted her while she was trying to teach to ask her about it, she said.

The chain of events that led to Haglin’s arrest on Friday is not clear. In any case, she is defending herself publicly and vociferously.

In an interview with KGAN, Haglin admitted she made a mistake by having an affair with an underage high school student but suggested that school district officials also made a mistake by continuing to give her substitute teaching assignments even though they were aware of the star-crossed romance.

“From April 17 to May 17, they knew — and certainly probably longer than that, probably since February when they first questioned me,” Haglin told KGAN.

Officials at Washington High asked Haglin to stop teaching at the school, she said, but she was then promptly assigned to be a substitute teacher at two Cedar Rapids elementary schools until the end of the school year.

“They didn’t ban me,” Haglin told The Gazette. “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.”

School district officials “knew full well that I was there,” Haglin added. “There was no way they could not have known. I’m sure that they were tracking me and checking me.”

“They tried to keep this under their hats so that it wouldn’t look bad for Washington High School,” she told KWWL.

In a Monday interview — apparently Haglin has chosen a local media-blitz as her defense strategy — the former substitute teacher called her run-in with the law and the night she spent in jail “sobering.”

“I do take responsibility. I’m not shying away from this. I’m facing this head on,” she told Cedar Rapids ABC affiliate KCRG-TV.

Haglin also said she is finished having sex with the high schooler.

“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,” she said, according to KCRG.

At the same, Haglin said the affair was a happy time.

“We both knew what could happen,” she told KWWL. “He gave me a lot of solace and comfort.”

“I do regret what took place,” Haglin added. “I did not intend for anything to get this far ever at all in my life, and so I do, you know, apologize to everybody involved for that.”

School district officials blame a glitch in their system for assigning substitute teachers as the reason that Haglin was able to teach at the two elementary schools after she left Washington High.

“Due to a miscommunication with the substitute placement system, the individual in question was placed in a substitute teaching position for a short time in an elementary setting at the end of the 2015-16 school year,” a statement from the district obtained by KWWL explains. “The District is not aware of any issues the substitute employee had while working in the elementary setting.”

“Providing for the safety of the District’s students is of paramount importance to the District,” the statement added.

School district superintendent Brad Buck said Haglin was asked to leave Washington High because of the rumors flying around.

“The sentiment of it was to allow her to leave with dignity given the current state of information and evidence that we had,” Buck told The Gazette.

Iowa’s age of sexual consent is 16. However, as in many states, there is an exception for situations when an adult is in a position of authority and has sex with a minor.

Haglin faces a charge of sexual exploitation by a school employee. After her night in the Linn County jail on Friday, she was released on her own recognizance and ordered to have no contact with the teen.

The sexual exploitation charge carries a prison term of up to two years. Haglin also faces the prospect of registering as a sex offender for the next decade.

Haglin is a graduate of Coe College, a private bastion in Cedar Rapids.

According to Heavy.com, Haglin’s now-defunct Facebook page explained that she is now working as a waitress at Leonardo’s Restaurant & Pizza — “the best pizza in town, a great bar, friendly people, a great atmosphere with relaxed lighting and private party rooms.”

Follow Eric on Twitter. Like Eric on Facebook. Send education-related story tips to erico@dailycaller.com.