A woman in El Salvador who was accused of attempting to abort her child was freed from jail on Monday, reported The Guardian. The woman had become pregnant in 2016 after being sexually abused by her stepfather. El Salvador has a strict anti-abortion law.

The 20-year-old woman Imelda Cortez was in prison since 2017 after giving birth to a child in a latrine in April. She faced up to 20 years in prison after prosecutors argued that failing to tell anyone about the pregnancy or seek medical attention for the baby amounted to attempted murder. Cortez had maintained that she did not know she was pregnant.

A court on Monday ruled that the woman had not tried to kill her child, according to BBC. Prosecutors reduced the charge from attempted murder to abandonment, which carries a 12-month jail term.

The judge said that the court could not expect the woman to have acted differently given the psychological damage she suffered since childhood due to sexual violence.

“This sentence... represents hope for women who are still in prison and are also being tried for aggravated homicide,” defence lawyer Ana Martinez said, following the verdict.

The woman’s stepfather now awaits trial for aggravated sexual assault of a minor, reported Al Jazeera.

In El Salvador, doctors have to inform authorities if they think a woman has tried to end her pregnancy. If they fail to report such cases, doctors too could face long sentences in jail, according to BBC.