The suspect was sentenced on Tuesday for luring Etan into the basement.

NEW YORK (AFP) - The man convicted in the infamous New York kidnap and murder of a six-year-old boy almost 40 years ago was sentenced to 25 years to life in prison on Tuesday.

In case that still haunts US parents and forever changed the handling of child abductions, Etan Patz vanished on May 25, 1979 after leaving his parents’ home in Manhattan to walk alone for the first time to the school bus stop.

Pedro Hernandez, then 18 years old and working in a convenience store near the bus stop, was convicted on Valentine’s Day after a second trial. The first trial ended in 2015 with the jury failing to reach a unanimous verdict.

The 56-year-old, who has been in custody since 2012, was sentenced on Tuesday for luring Etan into the basement of the convenience store with the promise of a soda, choking him and putting his body out with the trash.

While there was no material evidence against him, Hernandez confessed to the killing in 2012. He later retracted his confession and pleaded not guilty.

His defense lawyer says Hernandez is innocent and has an IQ of 70, which puts him in the bottom two percent of the population.

Etan’s parents attended Tuesday’s sentencing. His father, Stan, told Hernandez that he would never forgive him, US media reported.

"When a child is murdered, both a family and a community are fractured. For parents, it is a pain so profound that it has been described as a prolonged waking nightmare," said Manhattan district attorney Cyrus Vance.

"Today, the living embodiment of that nightmare -- Pedro Hernandez, the person that a jury unanimously convicted of killing Etan Patz 38 years ago -- is being sent to prison for the maximum sentence possible," he added.

Etan’s disappearance awakened Americans to the dangers of child abduction and fueled a generation of hyper-vigilant child rearing by parents terrified of letting their offspring out of their sight.

His parents only discovered he was missing after he failed to come home from school at the end of the day. His body was never found and the case was one of the city’s great unsolved crimes for decades.

Photographer Stan Patz’s pictures of his son were the first of a missing child featured on milk cartons in a nationwide search.

The judge declared a mistrial in May 2015 after just one jury member refused to convict Hernandez, saying he was swayed by arguments over his poor mental health and described the accused’s confession as "very bizarre."

In 1983, then US president Ronald Reagan declared the anniversary of his disappearance National Missing Children’s Day.

Etan was declared legally dead in 2001.