A former Montgomery County sheriff’s deputy pleaded guilty Monday to multiple counts of possession and distribution of child pornography, after investigators tracked him swapping graphic photos and videos of minors online.

Matthew Laver, 38, of Souderton, kept nearly 4,000 images of children as young as toddlers on his computer, an external hard drive, and his phone, prosecutors said.

Although he left the Sheriff’s Office in August 2015 — three years before his 2018 arrest by Montgomery County authorities — investigators found contraband photos and videos on his computer dating to his employment as a law enforcement officer and during a prior job as a carpenter in the U.S. Army Reserve.

“While responsible for enforcing the law, Laver himself was flagrantly violating it, and preying upon the most vulnerable of victims — young children,” Assistant U.S. Attorney Eileen Castilla Zelek wrote in court filings in April.

Laver’s attorney, federal public defender Maranna Meehan, did not immediately return calls for comment after Monday’s hearing. According to court filings, Laver confessed when confronted by investigators, saying that he often worried about getting caught.

Federal prosecutors adopted the case earlier this year. As a result of his guilty plea, Laver faces at least a five-year mandatory minimum prison term at a sentencing scheduled for January.