ALBANY, N.Y. (AP) — An upstate New York law enforcement officer has been charged with possessing child pornography.

According to the U.S. Department of Justice, Saratoga County sheriff's Sgt. Peter Farnum, of Ballston Lake, is accused of receiving and possessing child pornography. The 41-year-old appeared in federal court in Albany on Wednesday.

Investigators say Farnum stored thousands of pornographic images of children on a home computer between October 2015 and April 2016.

In a statement, Saratoga County Sheriff Michael Zurlo said Farnum is a seven-year member of the sheriff's office. Farnum was working as a patrol supervisor at the Milton station at the time of his arrest.

Farnum has been suspended without pay. He faces up to 20 years in prison if convicted of all charges. A message left with his lawyer, Cheryl Coleman, wasn't immediately returned.