A former Buffalo Grove middle school teacher was sentenced Tuesday to 13 years in federal prison for accessing pornography involving a child and encouraging minors to take sexually explicit photos of themselves.

In 2013, 54-year-old John C. Vastis began initiating “sexually charged” online conversations with one of the victims, according to a statement from the U.S. Attorney’s office.

For about a year, Vastis told the victim to record sexually explicit photos and videos and send them to him digitally, prosecutors said.

In a plea agreement, Vastis admitted to watching child pornography involving another victim and possessing other illegal, graphic images, prosecutors said.

Vastis, of Lakemoor, pleaded guilty last year to one count of accessing child pornography with the intent to view, prosecutors said. He was arrested in August 2014.

He previously worked as a teacher at Meridian Middle School in Aptakisic-Tripp District 102 in northwest suburban Buffalo Grove, prosecutors said. The school district cooperated with the investigation and there were no allegations of sexual exploitation of Vastis’s students.

The investigation was conducted under Operation Predator, an international initiative to protect children from sexual predators. Victims of sexual exploitation are encouraged to call their toll-free tip line at  (866) 347-2423.