NEW YORK — As he watched TV reports on a 33-year-old missing-child case, a man who’d never been a suspect started pondering whether he was the killer, he later told a psychologist.

“‘Did I (do) it?’ It was just a thought that came into my head,” Pedro Hernandez recalls in the psychologist’s report, part of a recent court filing that adds new details about his defense in a case that galvanized the missing-children’s movement. “I was, like, nervous and questioning myself … trying to make sense.”

Hernandez would soon tell police he did choke 6-year-old Etan Patz in 1979, confessing after investigators were tipped that he’d spoken of having harmed a child. But defense psychological experts later found him unsure of whether the brutal scenario he’d described was real or imaginary.

“I believed it in my mind that I did it, but I don’t think I did it,” Hernandez, 53, told one psychologist.

The interplay between belief and reality is shaping up to be a central issue in his murder trial, set for early next year. Since a judge ruled last week that jurors could hear Hernandez’s confession, it will be up to them to decide whether it was true.

His defense says it was fiction from a man with an IQ in the bottom 2 percent of the population and mental illness that makes it difficult for him to distinguish real life from fantasy. Prosecutors say his confession was legitimate, and they’re seeking to limit proposed expert testimony on the psychological phenomenon of false confessions.

“We believe the evidence that Mr. Hernandez killed Etan Patz to be credible and persuasive and that his statements are not the product of any mental illness,” the Manhattan district attorney’s office has said.

Etan vanished while walking to his school bus stop on May 25, 1979, now memorialized as National Missing Children’s Day. Hernandez then worked at a nearby corner store.

Etan was never found, and the investigation spanned decades. After police followed an ultimately fruitless lead to a Manhattan basement in April 2012 – the news Hernandez watched on TV – they got a tip about him. Authorities eventually learned that in the 1980s, the Maple Shade, New Jersey, man apparently told a friend, his now-ex-wife and a church prayer circle he’d hurt an unnamed child in New York City.

One listener remembers him saying he’d dismembered a boy, another recalls him describing strangling a child after being hit with a ball, and even the child’s race varied, according to one of three recently filed defense psychologist’s reports.

But after more than six hours of police questioning, Hernandez gave a calm, consistent account to police and prosecutors on video in May 2012: He choked Etan, put the still-living boy into a plastic bag, stuffed the bag in a box and dumped it on a street.

Hernandez has taken anti-psychotic medication for about a decade, and he’s been diagnosed most recently with schizotypal personality disorder.