A psychiatrist testified Friday that the man accused of murdering Etan Patz admitted he hurt a child in 1979.

The 6-year-old vanished while walking to his school bus stop.

Dr. Flavia Robotti said Friday that Pedro Hernandez told her he solicited a boy at the SoHo bodega where he worked, though she said Hernandez never said Etan Patz's name.

Robotti testified that she met Hernandez in 2012 at Rikers Island.

She said he was "squirming around in the chair...holding a rosary praying to God to forgive him."

She said he also told her, "I feel terrible...I hurt a child," and "Something came over me and...I strangled him."

"It doesn't matter who you're saying it to. He said to a lot of people post-arrest because he believed it at that point. The next day, if he was asked, he may have said something different. That's the point. Some days he believes it, some days he's not sure, some days he's positive," said Harvey Fishbein, Hernandez's attorney. "The problem is, he has difficulty distinguishing what's real and what's not real."

An NYPD detective who got Hernandez's confession on the record testified as well.

The defense cross-examination continues Monday.