When teenage Evelyn Hernández was found unconscious in a toilet in April 2016, her mother took her to a hospital outside San Salvador.

The daughter had given birth to a dead child. The hospital staff called the police. Evelyn Hernández was sentenced to 30 years in prison for murder.

The daughter denied the crime and has told her she was raped by a gang member and did not even know she was pregnant, according to The New York Times. Despite this, she was convicted on the basis of El Salvador's total ban, which does not even allow abortion if her mother's life is in danger.

"Thank God"

But the verdict, which drew sharp criticism internationally, has now been upheld. An appeals court on Monday released Hernández, who has already been locked up for almost three years.

"Thank God, justice has been shipped," a tear-eyed Hernández, today 21 years old, told a cheering crowd outside the court, according to AFP.

- But there are many women who are still locked up and I hope they will be released soon as well.

Can be appealed again

El Salvador's Supreme Court in February ordered a new trial and that Hernández should be released pending it. The Supreme Court then said that the original judgment was based on prejudice and lack of evidence, an opinion the Appellate Court thus shares.

The prosecutors, who have pleaded guilty to 40 years in prison, now have ten days to appeal the new verdict.

Amnesty: Scrap the abortion layers

El Salvador's bone-hard line in the issue of abortion has sparked debate. In March, three women who were sentenced after giving birth to stillborn children were released. In December, a woman charged with attempted murder after a premature birth was released. Around 20 women are still incarcerated in El Salvador in cases reminiscent of Hernández.

Amnesty International welcomes Monday's ruling and calls for El Salvador to change its laws.

"El Salvador must once and for all stop its shameful and discriminatory behavior in which women are criminalized," says Amnesty's US President Erika Guevara-Rosas.