Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The heartbroken father of little Etan Patz called his son's convicted killer a "monster" Tuesday before a New York City judge closed the book on the 38-year saga and sentenced the bodega worker to 25 years to life in prison.

Dressed in a jail-issued tan sweatshirt and matching pants, 56-year-old Pedro Hernandez barely flinched as Stan Patz took him to task for the 1979 killing of his 6-year-old son — a crime that struck terror into the hearts of parents in New York and across the nation and bedeviled the police for decades.

"After all these years we finally know what dark secret you had locked in your heart," Stan Patz said. "You threw him in the garbage. You are the monster in your nightmares. The God you pray to will never forgive you."

Before imposing his sentence, Justice Maxwell Wiley also blasted Hernandez, telling him "you caused the Patz family indescribable anguish."

Hernandez, however, insisted via his lawyer Harvey Fishbein that he didn't kill the little boy.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"He had two things he wanted me to say," Fishbein told the court. "He wants me to express the deep sympathy he has for the Patz family but also to make clear that he's an innocent man."

For Patz’s long-suffering parents, Stan and Julie, it was the end of a bitter ordeal that began on May 25, 1979 when their son vanished without a trace while walking to a bus stop, by himself for the first time, two blocks from the family’s home.

Stan Patz pauses while speaking to the media at Manhattan State Supreme Court following the sentencing of Pedro Hernandez in New York City on Tuesday. Lucas Jackson / Reuters

They canvassed their SoHo neighborhood with hundreds of flyers after Etan went missing. They refused to move or even change their phone number in the vain hopes that their son would be found alive.

And Etan’s disappearance helped spur the national movement to put photographs of missing kids on milk cartons.

“We, as New Yorkers and as a community of families all over the United States, were also changed forever," Manhattan District Attorney Cy Vance said in a statement. "Through this painful and utterly horrific real-life story, we came to realize how easily our children could disappear, ripped away from us right in our own neighborhoods."

Etan was declared dead in 2001, but police never stopped searching for him or his likely killer. And it wasn’t until 2012 when police, acting on a tip, tracked Hernandez down in South Jersey where he was living with his wife.

Hernandez, who was 18 when Etan went missing, later confessed to luring the boy into a bodega with the promise of a cold soda and then grabbing him by the neck and choking him to death. He said he stuffed Etan’s body into a box and dumped him in a nearby alley.

This combination of images shows a family photo courtesy of Stanley Patz and a New York City Police poster showing missing child Etan Patz. AFP - Getty Images

But Etan’s body was never found and prosecutors were unable to find anybody who saw Hernandez with the boy.

Meanwhile, Hernandez’s lawyers attacked his confession, claiming it was made by a mentally ill man.

They maintained the murder was actually committed by a convicted pedophile named Jose Ramos whose girlfriend baby-sat Etan and who had made incriminating statements in the past.

Hernandez’s first trial ended in May 2015 with a mistrial after 18 days of deliberations. It took another jury just nine days to convict Hernandez earlier this month of second degree murder and kidnapping in the first degree — and seal his fate.