An NYPD detective testified Thursday that the accused killer of Etan Patz said in early questioning that he was bound for heaven, but after hours in custody, he taped a sobbing confession to strangling the boy as investigators urged him to show the "strength of the Lord."

Pedro Hernandez, 53, charged in the disappearance of the 6-year-old, told detectives he had a message for the boy's parents.

"That I'm really sorry, that I never meant to hurt their child," he said. "I hope that they can forgive me."

The confession, the first of two made the day of his arrest in 2012, was played at hearings in Manhattan on whether his statements should be admitted at trial. The boy's father was in court as the tape played. Hernandez was arrested after a relative tipped police that he had indicated involvement in Etan's abduction as the boy headed to a school bus in SoHo.

In the statement at a New Jersey police station -- later repeated in New York -- Hernandez said he lured the boy to the bodega basement where he worked by offering a soda, strangled him, put his body in a box and dumped it in an alley. He has given no motive.

Hernandez's statements are the only known evidence against him. His lawyers say he has schizophrenia, bipolar disorder and a low IQ, fantasized a role in a crime he didn't commit, and was taken advantage of by police. NYPD Det. David Ramirez testified that during questioning, police brought up Hernandez's Pentecostal faith and asked if he would go to heaven. "He said yes, I've done nothing wrong and I've repented for my sins," Ramirez said.

He said Hernandez looked away when shown a missing-child poster of Etan, got angry when asked why he looked away, and said, "The police already got the guy who did that kid," referring to previous suspects. Ramirez said Hernandez confessed when told police had talked to people from his past. They then gave him Miranda warnings -- a key legal issue -- and videotaped his confession.

On tape, Hernandez is seated at a table with three officers. He appears to cry. One officer rubs the top of his head Another says, "That's strong. That's strong. That's the strength of the Lord."

Hernandez said he strangled Etan but the boy was moving when he dumped the body.

"I know that I did what I did, but he was alive, not dead," he said. "And somebody must have done something. I didn't kill him, I didn't do it. I'm not sure. I don't know what happened."

A detective asked Hernandez to write "this is the kid I strangled" on the poster with Etan's picture. Hernandez wrote but inserted a question.

"How do you spell choke?" he asked.

The hearings resume Friday.