CONCORD, N.H. — The U.S. Attorney’s office says a former New Hampshire boys’ basketball and baseball coach who pleaded guilty to producing child pornography has been sentenced to 25 years in prison.

Court documents say 25-year-old Matthew Riehl was junior varsity basketball coach at Goffstown High School and assisted coaching the basketball team at Mountain View Middle School. While posing as a teenage girl online, he contacted team members, persuading them to take sexually explicit photos of themselves and send them to him.

A search warrant was executed at his home in Goffstown in August 2016 and his cellphone was seized. An examination of the phone revealed about 500 photos of minor boys in various stages of dress.

Riehl pleaded guilty in October. He will register as a sex offender for life.