NEW YORK — The murder trial of a man accused in the 1979 disappearance of first-grader Etan Patz ended Friday in a hung jury, leaving one of the nation’s most wrenching missing-children cases still unresolved after nearly two generations.

After 18 days of deliberating, jurors said for a third time that they were hopelessly deadlocked – 11-1, in favor of conviction – in the case against Pedro Hernandez. The judge declared a mistrial as Hernandez sat impassively.

The Maple Shade, New Jersey, man was a teenage stock clerk at a Manhattan convenience store near where 6-year-old Etan vanished on May 25, 1979. He would become one of the first missing children ever pictured on milk cartons.

Prosecutors asked to set a new trial date in the case, which frustrated authorities for decades before a tip led them to Hernandez and he confessed in 2012. His lawyers said the confession was false and concocted by mental illness, and they said another longtime suspect was the more likely killer.

The mistrial left Etan’s parents, who became national advocates for the cause of missing children, to await another trial.

“We are frustrated and very disappointed the jury has been unable to make a decision. The long ordeal is not over,” said his father, Stanley Patz. But, he added, “I think we have closure already.”

He tried for years to bring the earlier suspect to account for Etan’s death, but after the trial, he said: “I am so convinced Pedro Hernandez kidnapped and killed my son. … His story is simple, and it makes sense.”

Hernandez will remain in jail to await another trial; the first took more than three months. He has a June 10 court date for a status update.

Several jurors said they found Hernandez’s confession compellingly detailed and buttressed by admissions he’d made to friends and relatives years before, and those jurors said they felt his mental problems were the result of a guilty conscience.

“Pedro Hernandez, you know what you did,” said forewoman Alia Dahhan.

The lone holdout said he felt Hernandez’s mental health history was “a huge part of this case” and couldn’t stop wondering about the roughly seven hours police questioned him before reading his Miranda rights and turning on a video camera.

“Ultimately, I couldn’t find enough evidence that wasn’t circumstantial to convict. I couldn’t get there,” said the juror, Adam Sirois, a health care consultant.

Jurors announced they were deadlocked twice before Friday, on April 29 and Tuesday. Both times, the judge told them to keep trying to reach a verdict.

Manhattan District Attorney Cyrus R. Vance Jr. said he believed there was “clear and corroborated evidence” of Hernandez’s guilt.

“The challenges in this case were exacerbated by the passage of time, but they should not, and did not, deter us,” Vance said.

One of Hernandez’s attorneys, Harvey Fishbein, said he recognized the Patzes and even New Yorkers at large were yearning to resolve the case.

“I would say there’s only a resolution if the correct man is held responsible, and we firmly believe Pedro Hernandez is not the right man,” he said.

After Etan’s disappearance, his parents helped shepherd in an era of law enforcement advances that make it easier to track missing children and communicate among agencies. The Patzes were at the White House when President Ronald Reagan named May 25 National Missing Children’s Day.

While New York City detectives frantically searched for the boy, Hernandez moved back to New Jersey and slipped off the radar. His name appears in police files only once, as someone officers encountered while canvassing the neighborhood, before his 2012 confession to choking the boy in the basement of the shop, then putting the body in a bag, putting the bag in a banana box, walking it about two blocks away and dumping it. But Etan’s body was never found. Nor was any trace of clothing or his belongings.