SAN ANTONIO (AP) — An ex-high school English teacher in San Antonio accused of throwing lewd parties for boys must serve 10 years in prison after pleading guilty to child sex abuse-related counts.

Prosecutors in San Antonio say Jared Anderson was sentenced Tuesday after pleading guilty to multiple counts of sexual performance by a child and indecency with a child by exposure.

The 29-year-old Anderson was a teacher at Judson High School when he was arrested in March 2016 on allegations he hosted sex parties for boys.

Police have said Anderson encouraged the boys to get naked and engage in sexual activity with him and each other during gatherings at his residence.

Authorities say Anderson later texted apologies to some parents amid the investigation.