The man who abducted, sexually molested and killed 11-year-old Jacob Wetterling in 1989 stood before a judge Tuesday and gave chilling details of the Minnesota boy's final moments.

Jacob’s parents, Patty and Jerry Wetterling, sat on the front row and listened as Danny James Heinrich of Paynesville, Minnesota, described how he took their son to a gravel pit, forced him to undress so he could molest him and then shot him after he cried and asked to go home. Heinrich, 53, confessed to Jacob’s murder as part of a plea deal with prosecutors in a child pornography case.

Heinrich faces a maximum of 20 years on the child porn charge to which he pleaded guilty, according to the Minneapolis Star Tribune. As part of the plea deal, another 24 child porn charges were dropped; Heinrich also escapes prosecution for Jacob's murder.

The now-confessed killer was arrested last year after about 150 images of child porn were found in his possession. It was following that arrest that he was officially named a person of interest in Jacob's disappearance.

Aside from the guilty plea, Heinrich also led investigators last week to Jacob’s remains, which were buried on a Paynesville farm. Paynesville is about 30 miles from where he abducted Jacob in St. Joseph.

Patty Wetterling told news media after Tuesday's plea hearing that it was "incredibly painful to know (Jacob's) last days, his last minutes," according to the Star Tribune. Still, she said, her son's legacy will continue.

“He’s taught us all how to live, how to love, how to be fair, how to be kind,” Wetterling said.

Jacob disappeared the evening of Oct. 22, 1989, as he rode home on his bike with his younger brother, Trevor, and his best friend. The three boys had gone to a nearby convenience store to rent videos and buy snacks.

The Star Tribune reported that Heinrich told the packed courtroom Tuesday that he was driving on a "dead-end road" in St. Joseph when he spotted the boys on their bikes with a flashlight. He stopped them and told the other two boys to run home and not look back.

Heinrich forced Jacob into the passenger seat of his car and handcuffed him, the newspaper reported.

“What did I do wrong?” Heinrich said Jacob asked.

Heinrich made Jacob duck down into the seat as he listened to a police scanner, which, after the other boys ran the half-mile back to the Wetterling home, crackled with news of the abduction. He drove Jacob to the gravel pit, where he walked him to a stand of trees.

It was there, Heinrich said, that he removed the handcuffs and Jacob’s clothes, and molested him. When the boy complained of being cold, he told him to get dressed.

Jacob asked to go home, but Heinrich told him he couldn't take him all the way home, at which point, the boy began to cry, the Star Tribune reported. Heinrich told the court he panicked and pulled out a revolver.

He said he told Jacob to turn away from him because he had to use the bathroom.

"I raised the revolver to his head. I turned my head and it clicked once. I pulled the trigger again and it went off. Looked back, he was still standing," Heinrich said, according to the newspaper. "I raised the revolver and shot him again."

Heinrich left, but returned later to bury Jacob’s body. He told the court that he moved the body a year later after he returned to the burial site and could see the boy’s jacket had begun to show through the soil.

The Star Tribune reported that Heinrich also detailed his molestation of another boy, 12-year-old Jared Scheierl, in Cold Spring, Minnesota, nine months before he abducted and murdered Jacob. Investigators long believed the two cases might be connected, due to the description of the suspect in each case, and Heinrich was tied by circumstantial evidence to the Cold Spring attack as early as February 1990.

He was physically linked to that case last year when DNA found on a sweatshirt Scheierl was wearing during the attack was matched to Heinrich's DNA profile, according to WCCO, Minneapolis' CBS affiliate. Prosecutors could not  bring charges against Heinrich in that assault, however, because the statute of limitations had expired.

Heinrich was also considered a suspect in 1991 when several paperboys in the Paynesville area reported being followed by a tan vehicle while on their routes, the Star Tribune reported. Though Heinrich at the time drove a similar vehicle, no charges were ever brought in those cases.