A teacher and assistant cheerleading coach admitted to a criminal relationship with a student after a nude photo began circulating the high school.

Administrators discovered 24-year-old Ashley Zehnder, a biology teacher and coach at Pasadena High School, was carrying on a sexual relationship with a 17-year-old on the cheerleading squad for several months.

Zehnder's affair was revealed after students at Pasadena High, which is in the surrounding area of Houston, were caught sending a nude selfie of the teacher on their cell phones, according to prosecutors. Ironically enough, the teacher in the photo was the one who complained to administrators about the spread of the picture.

Zehnder was charged in Harris County court with having an improper relationship with a student Monday KHOU reported.

"She admitted to sending the nude photo to the student, knowing in fact that he was a student, and that they had sex," assistant district attorney Nick Socias said to KHOU.

After Zehnder's complaint, the school district launched an investigation on Oct. 1. Upon further digging, investigators found out about the relationship and the boy admitted to the relationship with his teacher. She allegedly sent him the nude selfie and had been carrying on a sexual relationship with him between May and August of this year. According to Click 2 Houston, the pair would meet in Zehnder's apartment to avoid being seen.

The boy also reportedly admitted to receiving the photo from his coach via Snapchat and sharing it with friends.

Zehnder had been hired by the school district in August 2013. She resigned from the school Oct. 9.

"It's terribly unfortunate whenever a teacher violates trust of a student like that," spokesperson for Pasadena school Renea Ivy told a local ABC affiliate. "I think it makes it much harder for the other teachers who truly care about their obligation as an educator."