A detective central to the interrogation that led to the confession of Etan Patz’s accused killer defended the surprising tenderness he showed him at a hearing Tuesday in Manhattan court.

NYPD Detective Jose Morales of the Major Case Squad can be seen in Pedro Hernandez’s taped confession from May 23, 2012, sitting within arm’s reach of him, rubbing his head and back.

A flier distributed by the New York Police Department of Etan Patz, who vanished in New York on May 25, 1979AP

A defense lawyer for Hernandez asked Morales why he was showing the former bodega worker so much affection.

“The reason I was touching him was I was consoling him,” Morales answered. “I kept telling him it’s OK. It’s OK. You see me here, I’m a New York City detective but I’m also a human being. This guy was crying, so I was consoling him.”

Morales took the stand Tuesday at a hearing in Manhattan Supreme Court to determine whether Hernandez’s confession can be used at trial.

After nearly eight hours in police custody, Hernandez, a diagnosed schizophrenic, told cops he used a soda to lure 6-year-old Etan into the basement of the Soho deli where he worked and strangled him in 1979.

Defense lawyer Harvey Fishbein has argued that Hernandez — who has an IQ of 70 and borders on mental retardation — was psychologically coerced during the interrogation into believing he’d committed the horrific crime.