Three years ago, Scott Reskey downloaded “The Pedophile’s Handbook,” the feds say.

It spanned 576 pages and included chapters like “Finding Children” and “Hunting Season.” From there, it got much more specific.

But Reskey, 62, “didn’t stop in the realm of fantasy,” Assistant U.S. Attorney Grayson Walker wrote last month. Instead, he targeted a 7-year-old girl for grooming that led to hands-on sexual abuse in 2015 and the creation of photos and videos that “shock the conscience.”

The feds caught up with Reskey early last year. And Wednesday, U.S. District Judge Matthew Kennelly handed Reskey a 37-year prison sentence for production and possession of child pornography, according to the U.S. Attorney’s Office.

Ahead of his sentencing, the feds called his actions “morally abhorrent” and asked for a prison term of 50 years.

Reskey pleaded guilty last October. And in a recent letter to Kennelly, he called his own crimes “despicable in the extreme.”

“It pains me severely to think of the emotional and psychological trauma I caused the victim and the scars she will likely carry with her the rest of her life,” Reskey wrote.

The feds arrested Reskey in February 2017, having discovered a massive trove of child pornography on his computer that included 45,000 images and more than 200 videos. When agents approached him earlier, in March 2016, he admitted he looked at child porn “a couple” of times a week and had done so for more than 20 years.

During the investigation, the FBI recovered “The Pedophile’s Handbook” from Reskey’s laptop, which had apparently been downloaded in April 2015. One chapter offered to help readers “learn the basics about how to find yourself children through various methods, and how to befriend them,” records show.

Another offered to help readers learn “how to stay secure as an active pedophile, and how to handle civilians and police, even prisons, if things should go really wrong.”

Later in 2015, the feds say Reskey groomed and sexually abused the 7-year-old girl. While babysitting her, they said, he took her to private areas of his apartment and made her engage in sexually explicit poses, which he photographed and filmed.