A woman who was raped when she was a teenager, has been cleared of murdering her unborn baby conceived out of rape.

Evelyn Beatriz Hernandez, now 21, was suspected of having an abortion after she became pregnant when she suffered a brutal sex attack.

She was charged with homicide and was sentenced to 30 years in prison in El Salvador.

The case attracted international attention and activists called for her release.

People took to the streets to carry out peaceful demonstrations, demanding the release of the young victim.

Rape victim cleared of murdering unborn baby conceived out of rape

Evelyn had served 33 months in prison when her conviction was overturned in February for lack of evidence and a new trial was ordered.

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.

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

Evelyn’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.

The rape victim 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.

The young rape victim has now been acquitted by a judge at a retrial in a case that has attracted international attention to El Salvador’s strict laws.

Rape victim cleared of murdering unborn baby conceived out of rape

"Thank God, justice was done," an emotional Evelyn Hernandez said following the announcement of the verdict.

To the dozens of women who waited at the courthouse for the verdict, she said: "I also thank you who have been present here."

"Yes we did!" the woman chanted.

Rape victim cleared of murdering unborn baby conceived out of rape

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