A young rape victim who was suspected of having an abortion and charged with homicide has been acquitted by a judge at a retrial in a case that has attracted international attention to El Salvador’s strict laws.

Evelyn Beatriz Hernandez, now 21, had served 33 months of a 30-year prison sentence when her conviction was overturned in February for lack of evidence and a new trial was ordered.

Prosecutors had asked for a 40-year sentence.

The retrial was a first for such a case in the Central American nation, where prosecutors aggressively pursue legal cases against women who have miscarriages or other obstetric emergencies, accusing them of murder.

“Thank God, justice was done,” Ms Hernandez said following the announcement of the verdict, visibly emotional as dozens of women waited at the courthouse. “I also thank you who have been present here.”

Ms Hernandez is embraced by supporters after being acquitted
Ms Hernandez is embraced by supporters after being acquitted (AP Photo/Salvador Melendez)

“Yes we did!” the women chanted.

Ms Hernandez also thanked foreign diplomats who have followed the case closely.

The Associated Press usually does not name victims of alleged sexual assault, but Ms Hernandez has spoken publicly about her case.

Ms Hernandez’s fetus was at 32 weeks in 2016 when she felt intense abdominal pains and gave birth in an outdoor toilet. The baby was later found lifeless in a septic tank.

Ms Hernandez said she did not know she was pregnant and her mother said she found her passed out next to the toilet.

Both women said they did not know there was a fetus in the tank, but prosecutors did not believe them and pressed charges.

Forensic experts were unable to determine whether it died in the uterus or in the septic tank.

At the retrial, prosecutors’ argument against Ms Hernandez was commission by omission — that is, she failed to protect her fetus.

“We believe the judge has been very fair in his ruling,” defence lawyer Bertha Maria Deleon said. “He has said that there was no way to prove a crime and for that reason he absolved her.”

El Salvador is one of three Central American nations with total bans on abortion. Women convicted of having abortions face sentences of two to eight years.

Women and girls celebrate outside court following the case
Women and girls celebrate outside court following the case (AP Photo/Salvador Melendez)

But women who turn up at public hospitals following a miscarriage are sometimes accused of having killed the fetus and charged with aggravated homicide, which carries a sentence of 30 to 40 years. Such punishments often fall on poor, young women and victims of rape.

“This is a resounding victory for the rights of women in El Salvador. It reaffirms that no woman should be wrongly accused of homicide for the simple fact of suffering an obstetric emergency,” said Erika Guevara-Rosas, Americas director at Amnesty International.

Ms Guevara-Rosas called on El Salvador to cease “criminalising women once and for all by immediately revoking the nation’s draconian anti-abortion laws”.

El Salvador is a deeply religious country with 80% of the population identifying as Catholic or evangelical Christian. It is also home to macho attitudes on women’s role in society, as well as widespread gang violence.

“We judge cases based on religious convictions, often for things that should never enter in a courtroom,” defence lawyer Arnau Baulenas said.

Ms Hernandez, left,  stands with Teodora Vasquez, who was convicted and imprisoned for 10 years in a similar case before her sentence was eventually commuted
Ms Hernandez, left, stands with Teodora Vasquez, who was convicted and imprisoned for 10 years in a similar case before her sentence was eventually commuted (AP Photo/Salvador Melendez)

“We have to stop using justice to respond to social needs. Justice should do its work with criminals, not innocent people.”

Every year an estimated 25,000 women are impregnated after rapes in the country of just over six million.

It is believed that thousands of clandestine abortions are carried out each year in El Salvador.

Recent polls have shown broad support for more lenient abortion laws, though many in the country believe rape victims should be made to carry pregnancies to term.