A man charged with an infamous killing of a six-year-old New York City boy in 1979 pleaded not guilty Wednesday to murder, even though police say he has confessed in the sensational case.

Pedro Hernandez, 51, answered "not guilty" at the hearing in the case of Etan Patz. Hernandez's lawyer insisted his confession to police was false. Hernandez is charged with second-degree murder and first-degree kidnapping.

"My client had no motive and no history," defence attorney Harvey Fishbein said outside court.

"There is a serious question as to what happened in May 1979," Fishbein said. "There is no crime scene. There are no witnesses to a crime."

The boy’s disappearance led to an intensive search and sparked a movement to publicize cases of missing children. Patz's photo was among the first put on milk cartons.

He said that Hernandez confessed falsely after seven hours of questioning by police, and that he is still under medical and psychiatric care.

"My client is not happy that he is in jail," Fishbein said, noting that a body was never recovered.

Hernandez was a teenage stock clerk at a convenience store close to the bus stop where Etan was headed when he went missing on his way to school on May 25, 1979.

Based on a tip, police this spring approached Hernandez, now a married father with no criminal record living in New Jersey.

The tip came after federal authorities and police dug up a basement in the neighbourhood hoping for clues, putting the cold case back into the limelight once again.

Investigators say Hernandez told them he lured the boy into the convenience store with the promise of a soda.

According to police, he said he led the child to the basement, choked him and left his body in a bag about a block away.

According to a videotaped statement by Hernandez, Etan was alive when he left, his lawyer said in court papers.

Fishbein said he would seek to dismiss the case because the only evidence is his client's false confession.

If the case does go forward, Fishbein said the defence will revolve around his client's mental state.

Boy's parents not speaking

Etan's parents, Stan and Julie Patz, have not commented on the case.

They have been reluctant to move or even change their phone number in case their son tried to reach out.

Etan was declared legally dead by his father more than a decade ago so he could sue convicted child molester Jose Ramos in the boy's death.

Ramos was found responsible — a ruling made because he didn't entirely co-operate with questioning during the lawsuit -- and Fishbein could seek to make that a factor in Hernandez's defence.

Ramos, now 69, had been dating the boy's baby sitter in 1979 and was the prime suspect for years, but he was never charged. He repeatedly denies having anything to do with Etan's disappearance.

Ramos was later convicted of molesting two different children. He completed a 27-year sentence last month but was immediately arrested upon his release from a Pennsylvania prison, because authorities said he had given them a false address for where he had be living.