A former Pella Spanish teacher accused of sending explicit messages to students has entered his plea.

Juan Muñoz, 41, pled guilty to two counts of sexual exploitation by teacher, pattern or practice or scheme, a class D felony. The charges carry a mandatory prison sentence. According to the Pella Police Department, Muñoz sent a series of inappropriate messages in December 2016 to two students, both under the age of 18.

Muñoz was a teacher for the school district at the time of the offense. After learning of Muñoz’s illicit behavior, investigators took over a student’s email account and continued communications with Muñoz, receiving three unsolicited photos of Muñoz’s genitalia. Muñoz also attempted to invite one of the victims over to his residence while police were in control of the students’ accounts.

A sentence will be determined on September 21st.