By Natasja Sheriff

NEW YORK (Reuters) - A psychiatrist testified on Tuesday in defense of a former grocery store worker accused of murdering a New York City boy in 1979, saying the defendant has a mental illness that makes him unable to distinguish between hallucinations and reality.

Pedro Hernandez, 54, charged with kidnapping and murdering 6-year-old Etan Patz, confessed in 2012 to police that he choked the boy, stuffed him in a box and left him in a New York alley.

Patz vanished as he walked alone for the first time to a school bus stop in his Manhattan neighborhood on May 25, 1979. His disappearance sparked a national movement to find missing children, with his picture one of the first to appear on milk cartons.

Defense attorneys say Hernandez is mentally ill, concocted the confession under police coercion and suffers hallucinations. He could face life in prison if convicted.

Dr. Michael First, a psychiatrist at New York-Presbyterian Hospital, testified at Hernandez's trial that he diagnosed the defendant with a schizophrenic personality disorder in 2012, a few months after he was arrested.

Symptoms include paranoia, hallucinations and problems distinguishing imagination from reality, he said, as well as social anxiety and difficulty building relationships.

Hernandez recounted that a voice told him to approach a boy carrying a book bag and lure him into the basement of a Manhattan grocery where he worked, the doctor testified.

Hernandez also told him there were other people in the basement whom he described as old, gray-haired and wearing hospital-style gowns, First said.

Hernandez said he had seen some of the same people in his bedroom when he was a child but kept it secret because he did not want anyone to think he was crazy, he testified.

The psychiatrist's testimony echoed that of Hernandez's daughter Becky, who said in court on Monday that her father talked to himself and told her he saw imaginary people.

First also said Hernandez told him he strangled a child. But Hernandez had doubts the victim was Patz and was increasingly unsure of his story, the doctor added.

"His confusion about the reality of that has increased over time," he testified. "He's completely unclear about what's reality and what's not."

In his 2012 confession, Hernandez said he lured the boy into the Manhattan grocery store where he worked with the offer of a soda.

Patz has not been found. He was declared dead in 2001.

(Editing by Ellen Wulfhorst; Editing by Mohammad Zargham)