BUFFALO, N.Y. (AP) — A former New York teacher is going to prison for sending sexually explicit text messages to a 12-year-old girl.

Scott Schaefer pleaded guilty in August to disseminating indecent material to minors. The 44-year-old was sentenced Friday to one to three years in prison.

Authorities say Schaefer sent several texts to the girl in June. Her mother discovered the texts and reported them to police.

Schaefer was fired from his job as a science teacher at St. Gregory the Great School in the Buffalo suburb of Williamsville. He apologized to the girl and her family in state Supreme Court.

As part of his sentence, Schaefer is prohibited from contacting the girl until 2028.

More From WIBX 950