New York (AFP) – A former nanny was convicted of murder Wednesday in New York for stabbing to death two children who were in her care, as jurors rejected her insanity defense.

After two days of deliberations, the 12 jurors found Yoselyn Ortega guilty of four charges: two counts of first-degree murder and two counts of second-degree murder.

Ortega killed Lucia, then age six, and Leo, two, with a kitchen knife in the bathroom of their Upper West Side apartment on October 25, 2012.

The case terrified working parents all over the world and went on to inspire a best-selling novel that explored the relationship between a working mother and the woman she hires to look after her young children.

During six weeks of testimony in a Manhattan court, the defense had several doctors, including two psychiatrists, testify to try to convince the jury that Ortega, 55, should not be held responsible for the killings.

Defense lawyer Valerie Van Leer-Greenberg said Ortega suffered from “chronic mental illness” — she said Ortega had heard voices since she was 16 years old and suffered from depressive disorders, psychotic thinking and hallucinations that had gone untreated.

But prosecutors argued that Ortega harbored deep resentment against the children’s mother, Marina Krim, and that the killings were premeditated.

The murders served as the inspiration for “Chanson Douce” — a best-selling novel that earned author Leila Slimani France’s top literary prize, the Goncourt, in 2016.

The novel, set in Paris, was translated as “Lullaby” in Britain and in the United States as “The Perfect Nanny,” where it was less commercially successful than in Europe.