A psychiatrist testified in the Etan Patz murder trial Tuesday that defendant Pedro Hernandez told him as many as 15 people, some in nightgowns, were in the basement of a SoHo bodega watching when he purportedly strangled the 6-year-old boy in 1979.

Dr. Michael First, a defense expert called to try to convince jurors that Hernandez's 2012 confession was a fantasy caused by a mental disorder, said that the New Jersey man claimed "voices" told him to approach Etan, and that people from visions dating back to his youth were present.

"Some were coming down the stairs as he was strangling the boy," said First, who diagnosed Hernandez with a condition called schizotypal personality disorder. "Some were standing next to the boy."

More storiesComplete coverage: Etan Patz case

While that testimony added to questions about the confession, the defense was rocked by an unexpected ruling from Justice Maxwell Wiley letting prosecutors put in evidence that Hernandez was once a cocaine addict who hit his wife in fights over money for drugs.

The judge previously barred the evidence, which could lead jurors to view Hernandez as volatile and violent. Typically, prior "bad acts" are kept out for fear of prejudicing the jury. Wiley said he changed course because the past acts might affect the psychiatric diagnosis.

Hernandez, 53, of Maple Shade, New Jersey, confessed to NYPD detectives in 2012 that as a teen working in a SoHo grocery, he lured Etan into the basement by offering a soda, choked him, and put his body in a box, carrying him 1 1/2 blocks to an alley.

advertisement | advertise on newsday

Etan vanished on his way to catch a school bus, which stopped next to the bodega. Hernandez's daughter testified Monday in Manhattan Supreme Court that her father was a troubled man with no social life and eccentric habits who reported visions.

First testified that over three exams, the presence of observers became a "fixed part" of Hernandez's confession -- including a bald man, people with gray hair and white hair, old women, two little girls, a man in a suit, and someone wearing a pearl necklace.

Michael B. First, a psychiatrist who specializes in mental disorders, arrives, at Manhattan Supreme Court on the day he is expected to testify in the murder trial of Pedro Hernandez on Monday, March 09, 2015. Hernandez is on trial after confessing to the murder of Etan Patz in 1979. Photo Credit: Charles Eckert

"When he went up the steps with the body they parted," First said Hernandez told him. "And then they followed him."

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

The psychiatrist said the presence of others was as real to Hernandez as the purported killing itself, that Hernandez was never sure the boy he thought he strangled was Etan, and that over time his doubt rose as to whether he actually did anything. "He's completely unclear about what is real and what's not," First said.

After the judge opened the door, First acknowledged that Hernandez had a heavy cocaine habit -- as much as $300 a week at times -- from the mid-1980s until about 2005, and when his wife refused him money for drugs, their fights sometimes became violent.

But the psychiatrist said Hernandez exhibited symptoms of a mental disorder both before and after his cocaine phase, and it was separate from his drug abuse.

During cross-examination, First admitted that people with schizotypal personality disorder are capable of committing murder, and was asked by prosecutor Penelope Brady if Hernandez claimed to have killed any visions aside from Etan.

"No," he said.

advertisement | advertise on newsday

Just Etan? she asked. "Yes," he answered.

The trial is scheduled to resume Thursday.