It was a minor tabloid scandal: a Bronx high school teacher caught having a sexual relationship with a student. She was 32. He was in high school, 17 or 18. Soon, they moved in together and she was pregnant. They bought wedding bands.

But they began to argue: about how they would raise their son when he was born; about how the student, though still a minor, drank rum. And as quickly as it had begun, the illicit relationship seemed to be over and they had resumed their separate lives at DeWitt Clinton High School, she as a science teacher, he as a student.

Over the next four years, the woman, now a former teacher — her teaching certification was revoked because of the relationship — attended graduate school and raised their son. The former student, Isaac Duran Infante, paid child support and occasionally visited, but was otherwise kept at a distance.

On Monday, the former teacher, Felicia Barahona, and the boy, Miguel, 4, were found dead in their apartment in Upper Manhattan. By Tuesday, detectives were trying to learn as much about Mr. Duran Infante as possible. And on Tuesday night, the police announced that Mr. Duran Infante, 23, had been charged with two counts of first-degree murder.