AMHERST, Mass. (WWLP) – A Maryland man has been sentenced to four years in prison for a 2021 sexual assault of a teenager from Amherst.

According to Northwestern District Attorney Spokesperson Laurie Loisel, 42-year-old David Gray Jr. of Bel Air, Maryland was sentenced Tuesday in Hampshire Superior Court. He pleaded guilty to two counts of statutory rape and one charge of possession of child pornography.

Gray had a relationship with the teenager after they met on social media and exchanged hundreds of emails. Gray was later arrested on January 1, 2021 at a hotel in Hadley after the mother of the child alerted police that her daughter was missing.

“We hope this outcome brings some closure and a measure of justice for the survivor,” said Assistant District Attorney Andrew Covington.

In addition to four years in prison, Gray will have seven years of supervised probation where he must stay away from all children under the age of 18. He will also be required to register as a sex offender with the state.

The DA’s office noted that the family was relieved this case could be resolved without having a trial.