A court in El Salvador has acquitted at retrial a young rape victim who was suspected of having an abortion and charged with homicide.

The case of Evelyn Beatriz Hernández has attracted international attention to the country's strict abortion laws and prosecutors' aggressive pursuit of legal cases against women who have miscarriages or other obstetric emergencies.

Hernández's fetus was at 32 weeks when she felt intense abdominal pains and delivered it into a primitive toilet. She has said she didn't know she was pregnant.

After the verdict was announced Monday, she said "justice was done." The Associated Press usually does not name victims of alleged sexual assault, but Hernández has spoken publicly about her case.

She served 33 months of a 30-year prison sentence before her conviction was overturned.