An F.B.I. agent who worked on the Etan Patz case for nearly a decade testified on Friday that a previous suspect in the boy’s 1979 disappearance admitted to having sexually abused a young boy on the same day that Etan disappeared, though he called the boy “Jimmy.”

The former agent, Mary Galligan, who was assigned to the case in 1989, testified in State Supreme Court in Manhattan that in 1991 she interviewed Jose A. Ramos, a convicted child molester and the man that lawyers for Pedro Hernandez, who is being tried on murder charges in the case, have tried to cast as an alternate suspect.

During an interview at a prison in Otisville, N.Y., that she said lasted more than four hours, Ms. Galligan said that Mr. Ramos assumed that she and the other agent she was with “were there to talk about the Etan Patz case.” Ms. Galligan said Mr. Ramos referred to sexual crimes that he said he had committed in the past as having been committed by “the old Jose, or the other Jose or the bad Jose.” Ms. Galligan said she asked him to tell her about “the old Jose.”

She said that Mr. Ramos then told a story about how it was “the old Jose” who was in Washington Square Park the day Etan disappeared. Mr. Ramos told Ms. Galligan that he saw “a young boy playing handball” who said his name was Jimmy and that the boy had an aunt who lived in Washington Heights, Ms. Galligan said. She said that Mr. Ramos then took the boy back to his apartment and “did to the boy what the old Jose said he did to children.” Afterward, Ms. Galligan said, he told her he put the boy on a subway headed uptown.