BALTIMORE — A former Maryland priest was sentenced Wednesday to 22 years in federal prison followed by lifetime supervised release for coercion and enticement of a child he met through the church to engage in illegal sexual activity.

Fernando Cristancho, 65, who served as a priest from 1999 to 2002 at St. Ignatius Church in Hickory, also admitted producing nude images of four other children, U.S. Attorney Erek Barron announced in a news release. Upon his release, Cristancho must register as a sex offender in the places where he lives, works and studies.

The plea agreement said that when Cristancho arrived at the parish in 1999, he spent time with a boy’s family outside of church, then arranged to spend time with the boy and sexually assaulted him over several years.

When Cristancho went to a retail pharmacy in 2017 to use photo printing equipment, an employee noticed several photos of naked children on Cristancho’s smartphone and made a report, prosecutors said. Investigators later seized digital devices at Cristancho’s home and found photos and videos of children, mostly recorded when the children were younger than 5.

A statement posted on the archdiocese’s website said Cristancho has not been permitted to function as a priest in the archdiocese since 2002 when he refused an assignment to another parish.