After confessing to strangling 6-year-old Etan Patz, Pedro Hernandez told his wife and daughter that he was likely to be in jail for the rest of his life and then reminded them to change the oil in the family car, a detective testified Friday.

NYPD Det. David Ramirez, appearing at a Manhattan court hearing on Hernandez's 2012 confession, said cops let the ex-bodega worker meet with his family before he was taken from New Jersey back to the city to face charges in the notorious 1979 disappearance.

Ramirez said the odd reminder came after Hernandez disclosed the dramatic news of his crime at a police station in Camden, New Jersey, telling stunned wife Rosemary and his teenage daughter: "I did something terrible a long time ago. I don't know why I did it."

After he described what he had done, the detective recalled, Hernandez urged his daughter to finish school, and then added, "Rosemary, remember to have the oil changed when the car hits 5,000 miles."

"He was calm," Ramirez said. " . . . They were crying."

Hernandez, 53, a janitor from Maple Shade, New Jersey, is charged with murder and kidnapping in the long-unsolved disappearance of Etan while walking to catch a school bus in SoHo. He confessed to strangling the boy in the basement of the bodega where he worked and dumping the body in a box.

Defense lawyer Harvey Fishbein says Hernandez, a bipolar schizophrenic with a low IQ, fantasized his role in the crime and was manipulated by police, who hugged him and urged him at one point to show "the strength of the Lord" during a marathon interrogation. He is seeking to have the confession thrown out.

In addition to two videotaped confessions played in court this week, prosecutors on Friday played a cellphone video made by an NYPD lieutenant in 2012 of Hernandez leading cops on a tour of the SoHo neighborhood where he says the crime occurred.

On the walk from the 1979 location of his bodega at West Broadway and Prince Street to a stairwell on Thompson Street, where he said he lugged Etan, Hernandez paused in front of a grocery and pointed to a cardboard container used to ship produce.

"That's the kind of box I used to put the body in," he said.

The hearings, expected to last for a month, resume next week.