A suspect's confession to choking a 6-year-old boy to death in 1979 may be used at his murder trial, a judge ruled Monday, allowing prosecutors to use what appears to be their key evidence in one of the nation's most notorious missing children's cases.

The suspect, Pedro Hernandez, 53, has pleaded not guilty to killing 6-year-old Etan Patz, one of the first missing children ever pictured on a milk carton. He vanished while walking to his school bus stop. His defense has said his confession to the wrenching crime was imaginary.

State Supreme Court Justice Maxwell Wiley wasn't tasked with determining whether the admission was true -- just whether it was obtained legally and whether Hernandez comprehended what he was doing when he waived his right to stay silent.

After decades of investigation that stretched as far as Israel, Hernandez emerged as a suspect in 2012. He'd been a stock clerk at a store in Etan's neighborhood when the boy disappeared.

After more than six hours of questioning, he confessed on video, calmly telling investigators how he choked Etan in the store basement. He describes putting the boy, who was still alive, into a plastic bag, then putting the bag inside a box and dumping it nearby.

"I was nervous; my legs were jumping," Hernandez said on the tape. "I wanted to let go, but I just couldn't let go. I felt like something just took over me. I don't know what to say. Something just took over me, and I was just choking him."

In the 1980s, Hernandez also allegedly told a prayer group and others that he'd harmed a child in New York. But authorities have not pointed to any physical or scientific evidence against him, and his defense has said there is none.

Etan's body was never found. The day he vanished became National Missing Children's Day.

Hernandez' attorney, Harvey Fishbein, has said that Hernandez didn't have the mental capacity to understand his right to remain silent.

Hernandez' IQ, about 70, puts him in the bottom 2 percent of the population, a defense psychological expert testified during a weeks-long hearing this fall.

His lawyer has said Hernandez' medical records mention schizophrenia dating back years, he has long taken anti-psychotic medication and since his arrest he's been diagnosed with schizotypal personality disorder. Its effects on him include "cognitive and perceptual distortions," including hallucinations, Fishbein has said. In one of the confessions, Hernandez says he has had visions of his dead mother.

Prosecutors say the confession was real and properly obtained.

"The evidence convincingly demonstrated that he knowingly waived those rights and voluntarily provided a statement," Manhattan Assistant District Attorney Joan Illuzzi-Orbon wrote in a court filing. Hernandez had gone through 11th grade without special education or remedial summer school, represented himself in a prolonged divorce and child support proceeding, participated in his church, and successfully applied for Social Security disability benefits, the prosecutor noted.