A Minnesota man who confessed to abducting, sexually assaulting and killing 11-year-old Jacob Wetterling 27 years ago was sentenced Monday to 20 years in prison on a child pornography count that let authorities close the books on a mystery that had haunted the state for nearly three decades.

Danny Heinrich, 53, led authorities this summer to the field where he buried Jacob's remains. As part of his plea bargain, prosecutors agreed not to charge Heinrich with murder.

The sentence handed down by U.S. District Judge Donovan Frank was the maximum the law allowed, though the plea deal allows state authorities to seek Heinrich's civil commitment as a sexual predator at the end of his federal prison term, which could prevent him from ever going free.

While some questioned whether it was adequate punishment, Jacob's parents, Patty and Jerry Wetterling, have agreed with prosecutors that it was their best hope.

Jacob was abducted by a masked gunman on Oct. 22, 1989, while biking with his brother and a friend near his home in the central Minnesota community of St. Joseph. Early in the investigation, authorities questioned Heinrich, who maintained his innocence. But he came under renewed scrutiny when authorities decided to take a fresh look at the case around the 25th anniversary of the kidnapping.

As part of that effort, investigators used new technology to go back to a sex assault cause of a 12-year-old Cold Spring boy that happened nine months before Jacob's disappearance. They found Heinrich's DNA on that boy's sweatshirt, and used that evidence to get a search warrant for Heinrich's home in Annandale, where they found his child pornography collection last year.

After months of denials, Heinrich agreed in late August to confess to killing Jacob and the Cold Spring sex assault.

Heinrich detailed his crimes in chilling detail in court in September, recounting how a handcuffed Jacob asked him, "What did I do wrong?"

He said he drove the boy to a gravel pit near Paynesville and molested him. After a patrol car with siren and lights passed nearby, he fired two shots at Jacob's head, killing him.

Patty Wetterling became a national advocate for missing children after Jacob's disappearance. A 1994 federal law named for Jacob requires states to establish sex offender registries.

In a court filing last week, defense attorney Reynaldo Aligada said Heinrich has shed "countless tears" for Jacob and his family in the decades since he killed him but has never touched another child since then.

In a separate filing, prosecutors said Heinrich caused pain and suffering beyond measure, and his silence let the unsolved disappearance "grow like a cancer" throughout the community, letting innocent people become the targets of police interest.

"Heinrich killed a little boy who did nothing wrong and deserved to live. This little boy's family deserved to watch him grow-up, to hold him, and to love him not just for who he was, but for who he would become. Heinrich stole all that in a moment, and now 27 years later he deserves his punishment," they wrote.