A convicted child molester claimed he accosted a young boy who looked like Etan Patz the same day in 1979 that Patz disappeared, a former federal prosecutor told a jury on Monday at the trial of another man accused of murder in the infamous missing child case.

Key defense witness Stuart GraBois recounted how, once ruling out family members as suspects, he located Jose Ramos in prison in the late 1980s after learning the Ramos had ties to a woman who was once used by the family to walk 6-year-old Etan home from school during a bus driver strike. The former assistant to then-U.S. Attorney Rudy Giuliani described soothing Ramos with small talk before suddenly asking him, "How many times did you have sex with Etan Patz?"

"He froze and got tearful, and said, 'I want to tell you all about it. I want to get it off my chest,'" GraBois testified.

Ramos claimed that he had encountered Patz in Washington Square Park in Greenwich Village before luring the boy to his apartment to try to have sex with him, GraBois said. The suspect, having seen Patz's photo on television and on missing posters, was "90 percent sure" it was the same boy, he said.

After the boy resisted his advances, Ramos claimed he put him on a subway train so he could go to his aunt's home. GraBois said he considered that a lie, telling Ramos, "I don't believe you."

GraBois launched an investigation that resulted in an unrelated sex abuse conviction against Ramos in Pennsylvania. But the prosecutor failed to make a case against him in Etan's disappearance after Ramos refused to ever speak again with authorities about the boy, whose body was never found.

The imprisoned Ramos, now 71, was scratched as a potential defense witness in the trial of Pedro Hernandez after he threatened to invoke his Fifth Amendment protection against self-incrimination if called to the stand. But with testimony about Ramos' alleged confession and by highlighting his history of molesting children, the defense has sought to portray him as a more plausible suspect than the 54-year-old Hernandez.

Etan vanished on May 25, 1979 after leaving his family's SoHo townhouse to walk to the bus. The disappearance helped galvanize the modern-day missing children's movement, with his picture one of the first to appear on a milk carton.

After police received a fresh tip in 2012, Hernandez confessed that he choked Etan in the basement of a New York City convenience store where he worked after luring the boy there with the promise of a soda. He said he bagged the body and dumped it a few blocks away.

Defense attorneys are trying to show that the defendant is mentally ill and that his lengthy videotaped confession is a delusion. Prosecutors say Hernandez's admissions are sound.