Katherine Ruth Harper, 28, will serve six years in prison after she pleaded guilty to having sex multiple times with a 15-year-old student

A married middle-school English teacher and cheerleading coach will serve six years in prison after she pleaded guilty to having sex multiple times with a 15-year-old student while she was pregnant.

Katherine Ruth Harper, 28, was arrested in April of last year and charged with having an improper relationship with a student in Trophy Club, Texas, a wealthy suburb northwest of Dallas.

She pleaded guilty to one court of sexual assault and one count of having an improper relationship with a student, the Denton County District Attorney's Office said.

After her prison sentence, Harper will be placed on 10 years' probation. She will also be required to register as a sex offender for the rest of her life.

Harper, a seventh-grade teacher at John M Tidwell Middle School, traded several nude photos with the boy by cell phone, according to the Star-Telegram.

The affidavit says police launched an investigation into the alleged inappropriate relationship after receiving an anonymous tip through the school district website naming Harper and the student, whose identity is being withheld because he is a juvenile.

When a school official confronted the boy with questions about the relationship, he cried and admitted to sex with the teacher, according to the affidavit.

Scroll down for video

Harper (pictured above) traded several nude photos with the boy by cell phone. 'One thing led to another and she told me to "put it in" and I did,' the boy told cops

Harper was a teacher at John M Tidwell Middle School in Texas. The boy was her student there last year and the two began a sexual relationship over 2016 summer break

Harper's home in Fort Worth is shown. The boy told investigators that she came over to his house in the summer of 2016 and the two drank before having sex. Harper was eight months pregnant at the time of her arrest

The boy was formerly a middle school student of Harper's.

The teacher and student began trading racy text messages before meeting at the boy's home for sex over the summer break, the affidavit claims.

In an interview with a state child protective services investigator, the boy said that Harper came over to his house and the two drank alcohol together before taking their clothes off, according to the affidavit.

'One thing led to another and she told me to 'put it in' and I did,' the boy told investigators, according to Fox4.

The boy said he and Harper had sex multiple times after that in June and July of 2016.

Police seized the boy's cell phone and found records indicating the two communicated 76 times over that time period.

Harper is now pregnant, but it's unclear from the affidavit whether the boy is the father of the child.

'She's about eight months pregnant, so if we go back in time it's around when that event took place, but she is married, we believe, still. So we're not sure what that leads to,' Trophy Club Police Chief Patrick Arata told Fox4.

Harper has been released on a $15,000 bond.