William Randall (Courtesy of Pa. State Police)

A York County man has been indicted in federal court for allegedly failing to register as a sex offender.

William W. Randall, 41, is charged with knowingly failing to register under the Sex Offender Registration and Notification Act, according to the U.S. Attorney's Office in Harrisburg. The law is part of the Adam Walsh Child Protection and Safety Act.

Randall was convicted of a sex offense against a minor in South Carolina, according to Pennsylvania's Megan's Law website.

If convicted of failing to register, he faces up to 10 years in prison.