Moments after Danny Heinrich abducted Jacob Wetterling on a rural road in Minnesota, the man handcuffed the 11-year-old boy and forced him into a car.

Jacob looked at Heinrich and asked, "What did I do wrong?"

Soon, Jacob was dead.

Giving graphic details in a Minnesota courtroom, Heinrich laid to rest a 27-year-old mystery: What happened to Jacob in 1989 after he was abducted by a masked man holding a gun?

Heinrich admitted in court Tuesday that he abducted, sexually assaulted and killed the boy.

Now 53, Heinrich made the admission as he pleaded guilty to federal child pornography charges, The Associated Press reported.

He told the court that he sexually assaulted the boy in a rural area of Paynesville, near where the assailant lived with his father.

During the assault, Heinrich told the court that Jacob said he was cold and wanted to go home, according to CBS affiliate WCCO. Later, Heinrich thought police were headed to his location, WCCO reported, adding:

Heinrich panicked and took out his revolver as Wetterling had his back to him. He then pulled the trigger, but the gun didn't go off. He pulled the trigger again, shooting Wetterling in the back of the head. He shot a third time, and Wetterling collapsed.

He buried the boy about 100 yards away.

Heinrich also said he sexually assaulted another Minnesota boy, 12-year-old Jared Scheierl, nine months before Jacob disappeared, according to the AP. Scheierl survived.

Heinrich was never charged in Jacob's death, although he was one of the first people interviewed by investigators. He maintained his innocence for years, and prosecutors never had enough evidence to charge him.

But Tuesday, according to the AP, Henrich was asked in court whether he had abducted, sexually assaulted and murdered Jacob.

"Yes I did," he said, with Jacob's parents, Patty and Jerry Wetterling, in the courtroom.

Tuesday's admission was part of a plea deal with federal prosecutors on the child pornography charges. The deal could land Heinrich at a facility where he wouldn't be in as much danger as a convicted sex offender, WCCO reported.

His testimony capped a week of dramatic developments in Jacob's case, which began last week when Heinrich led investigators to the boy's body in field in Paynesville.

On Oct. 22, 1989, Jacob was abducted by a man wearing a mask and holding a gun. The 11-year-old had been riding bikes with two other boys. The armed man told the trio to lie face down in a ditch and tell him their ages.

Then he grabbed Jacob and told the other boys to run and not look back.

In the years that followed, police pursued more than 50,000 leads in the case.

Every Oct. 22, on the anniversary of Jacob's disappearance, Minnesotans leave their porch lights on. They did the same over Labor Day weekend, as news in the case traveled around the world.

Jacob's mother, Patty Wetterling, used her son's disappearance to lobby for better laws tracking sex offenders and marshaling resources to quickly find missing children.

In 1994, the federal Jacob Wetterling Crimes Against Children and Sexually Violent Offender Registration Act led to the creation of a national sex offender registry. The Star Tribune of Minneapolis called the Wetterlings and the foundation they established "the driving force" behind the registry.

In the days since Heinrich led authorities to the buried remains of Jacob Wetterling, the boy's family remained silent, deep in their own grief.

But on Monday, Patty Wetterling broke her silence.

A day before Heinrich's trial, she wrote a brief message on the Jacob Wetterling Resource Page, the organization set up to help prevent child exploitation.

"Everyone wants to know what they can do to help us," she wrote.

"Say a prayer.

"Light a candle.

"Be with friends.

"Play with your children.

"Giggle.

"Hold Hands.

"Eat ice cream.

"Create joy.

"Help your neighbor."

She added: "That is what will bring me comfort today."