Etan Patz went missing in 1979, and his body was never recovered.

A former pal of 6-year-old Etan Patz’s accused killer, Pedro Hernandez, testified Wednesday that the suspect told him decades ago that he had “got angry and strangled” a child.

Mark Pike, 53, lived across the street from the Hernandez family in Camden, N.J., and was friendly with Hernandez and some of his siblings, he testified.

One day, while on Hernandez’s porch, the man accused of abducting and murdering Etan in 1979 allegedly told Pike an eerie story.

Pike said Hernandez told him he was working at a grocery store in New York City when he was hit in the throat with a ball by a kid playing in the street.

“He got angry. He strangled him and he lost it,” Pike testified during direct examination by prosecutor Joel Seidemann.

Hernandez allegedly disclosed that he “put (the kid) in a bag in a dumpster behind the store,” according to the testimony in Manhattan Supreme Court.

When Pike probed for an explanation, Hernandez shut the conversation down.

“Don’t worry about it. Forget about it,” Hernandez allegedly said. “It was a black kid.”

On Tuesday, two members of a religious group Hernandez was a part of testified that he tearfully admitted at a retreat in Hamilton, N.J., that he killed a boy around the time of Etan’s disappearance.

Prosecutors say the admissions Hernandez made — long before he was reported to cops — corroborate the detailed confession he gave to the NYPD and prosecutors in 2012.

But Hernandez’s lawyers say he is mentally ill and has difficulty separating fiction from reality.

Pedro Hernandez’s former friend said the accused killer started to admit to murdering a child, but then started to backtrack his story.

They say he fantasized that he took Etan, who went missing on his way to the school bus stop next to the corner bodega at Prince St. and West Broadway where Hernandez and his brother-in-law worked.

Hernandez was also questioned by police for seven hours with very little record of what was said.

He was on the ground in a fetal position and asked to go home, his lawyers said.

Hernandez, 55, confessed in 2012 to taking the boy.

There’s no physical evidence tying Hernandez to the murder.

Etan’s body was never found — and the boy was declared legally dead in 2001.

Prosecutors have noted that Hernandez left his job at the bodega — where he says he killed the boy in the basement before dumping his body — days after Etan’s disappearance to take a less lucrative job at a New Jersey dress company.

Last year, after weeks of deliberating, a mistrial was declared after one holdout juror said he could not convict Hernandez because he did not think the evidence was sufficient.

The new jury that is hearing the retrial consists of eight men and four women, and includes an electrical engineer for the MTA, a City College faculty member and a drug court resource coordinator.