A rape victim who faced up to 40 years in prison after she suffered a stillbirth has been cleared at retrial.

Evelyn Hernández was sentenced to 30 years in prison for aggravated homicide by a court in El Salvador in July 2017. She was prosecuted under the Central American country's strict abortion laws.

Now 21, she became pregnant after she was raped by a gang member when she was 18-years-old.

Ms Hernández has always maintained that she was unaware she was carrying a child.

After fainting in an outhouse near her home in April 2016, her mother took her to the hospital, where doctors found she had given birth. The body of a baby was later found in a toilet septic tank and the teenager was arrested.

Protests across US after abortion laws enforced Show all 20 1 /20 Protests across US after abortion laws enforced Protests across US after abortion laws enforced Missouri Thousands of demonstrators march in support of Planned Parenthood and pro-choice as they protest a state decision that would effectively halt abortions by revoking the license of the last center in the state that performs the procedure, during a rally in St. Louis, Missouri, May 30, 2019. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images) SAUL LOEB AFP/Getty Protests across US after abortion laws enforced Alabama MONTGOMERY, AL - MAY 19: Lindsey Shelton participates in a rally against one of the nation's most restrictive bans on abortions on May 19, 2019 in Montgomery, Alabama. Demonstrators gathered to protest HB 314, a bill passed by the Alabama Legislature last week making almost all abortion procedures illegal. (Photo by Julie Bennett/Getty Images) Julie Bennett Getty Protests across US after abortion laws enforced New York Alison Hickerson from New York City poses for a photo as she take part in a rally in front of the Middle Collegiate Church in the East Village of New York May 21, 2019. - Demonstrations were planned across the US on Tuesday in defense of abortion rights, which activists see as increasingly under attack. The "Day of Action" rallies come after the state of Alabama passed the country's most restrictive abortion ban, prohibiting the procedure in all cases, even rape and incest, unless the mother's life is at risk. Alabama is among about 14 states which have adopted laws banning or drastically restricting access to abortion, according to activists. (Photo by TIMOTHY A. CLARY / AFP) (Photo credit should read TIMOTHY A. CLARY/AFP/Getty Images) TIMOTHY A. CLARY AFP/Getty Protests across US after abortion laws enforced Georgia ATLANTA, GA - MAY 21: Melissa Simpson holds up her arm with "My Body My Choice" written on it during a protest against recently passed abortion ban bills at the Georgia State Capitol building, on May 21, 2019 in Atlanta, United States. The bill would ban abortion when a fetal heartbeat is detected. The Alabama abortion law, signed by Gov. Kay Ivey last week, includes no exceptions for cases of rape and incest, outlawing all abortions except when necessary to prevent serious health problems for the woman. Though women are exempt from criminal and civil liability, the new law punishes doctors for performing an abortion, making the procedure a Class A felony punishable by up to 99 years in prison. (Photo by Elijah Nouvelage/Getty Images) Elijah Nouvelage Getty Protests across US after abortion laws enforced Atlanta ATLANTA, GA - MAY 21: Women hold signs during a protest against recently passed abortion ban bills at the Georgia State Capitol building, on May 21, 2019 in Atlanta, Georgia. The Georgia "heartbeat" bill would ban abortion when a fetal heartbeat is detected. The Alabama abortion law, signed by Gov. Kay Ivey last week, includes no exceptions for cases of rape and incest, outlawing all abortions except when necessary to prevent serious health problems for the woman. Though women are exempt from criminal and civil liability, the new law punishes doctors for performing an abortion, making the procedure a Class A felony punishable by up to 99 years in prison (Photo by Elijah Nouvelage/Getty Images) Elijah Nouvelage Getty Protests across US after abortion laws enforced Alabama Pro-Choice protesters march through the streets of Birmingham, Alabama, during the March For Reproductive Freedom on May 19, 2019. - The state of Alabama passed a near-total abortian ban on May 14, 2019, one of the nation's most restrictive bans on abortions in decades. (Photo by Seth HERALD / AFP) (Photo credit should read SETH HERALD/AFP/Getty Images) SETH HERALD AFP/Getty Protests across US after abortion laws enforced Missouri ST LOUIS, MO - MAY 31: Pro-Choice supporters, along with Planned Parenthood staff celebrate and rally outside the Planned Parenthood Reproductive Health Services Center on May 31, 2019 in St Louis, Missouri. A judge has issued an order allowing Missouri's only abortion clinic to continue providing the service and maintaining their license until June 4. (Photo by Michael Thomas/Getty Images) Michael Thomas Getty Protests across US after abortion laws enforced Alabama Pro-Choice protesters march through the streets of Birmingham, Alabama, during the March For Reproductive Freedom on May 19, 2019. - The state of Alabama passed a near-total abortian ban on May 14, 2019, one of the nation's most restrictive bans on abortions in decades. (Photo by Seth HERALD / AFP) (Photo credit should read SETH HERALD/AFP/Getty Images) SETH HERALD AFP/Getty Protests across US after abortion laws enforced Georgia ATLANTA, GA - MAY 21: People hold signs during a protest against recently passed abortion ban bills at the Georgia State Capitol building, on May 21, 2019 in Atlanta, Georgia. The Georgia "heartbeat" bill would ban abortion when a fetal heartbeat is detected. The Alabama abortion law, signed by Gov. Kay Ivey last week, includes no exceptions for cases of rape and incest, outlawing all abortions except when necessary to prevent serious health problems for the woman. Though women are exempt from criminal and civil liability, the new law punishes doctors for performing an abortion, making the procedure a Class A felony punishable by up to 99 years in prison (Photo by Elijah Nouvelage/Getty Images) Elijah Nouvelage Getty Protests across US after abortion laws enforced Georgia ATLANTA, GA - MAY 21: Melissa Simpson snaps her fingers in support of a speaker during a protest against recently passed abortion ban bills at the Georgia State Capitol building, on May 21, 2019 in Atlanta, Georgia. The Georgia "heartbeat" bill would ban abortion when a fetal heartbeat is detected. The Alabama abortion law, signed by Gov. Kay Ivey last week, includes no exceptions for cases of rape and incest, outlawing all abortions except when necessary to prevent serious health problems for the woman. Though women are exempt from criminal and civil liability, the new law punishes doctors for performing an abortion, making the procedure a Class A felony punishable by up to 99 years in prison (Photo by Elijah Nouvelage/Getty Images) Elijah Nouvelage Getty Protests across US after abortion laws enforced Missouri Thousands of demonstrators march in support of Planned Parenthood and pro-choice as they protest a state decision that would effectively halt abortions by revoking the license of the last center in the state that performs the procedure, during a rally in St. Louis, Missouri, May 30, 2019. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images) SAUL LOEB AFP/Getty Protests across US after abortion laws enforced Washington, DC WASHINGTON, DC - MAY 23: People wait for the start of a news conference regarding womenâ€™s health care, on Capitol Hill May 23, 2019 in Washington, DC. The news conference was held to discuss the reintroduction of the "Women's Health Protection Act " and address the state-based attacks on abortion rights. (Photo by Mark Wilson/Getty Images) Mark Wilson Getty Protests across US after abortion laws enforced Louisiana Handsmaid themed protesters stand outside Jackson Square in the French Quarter of New Orleans, Louisiana, on May 25, 2019, to protest the proposed Heartbeat Bill that will ban abortion after 6 weeks in that state, scheduled for a vote on May 28. (Photo by Emily KASK / AFP) (Photo credit should read EMILY KASK/AFP/Getty Images) EMILY KASK AFP/Getty Protests across US after abortion laws enforced Louisiana Handsmaid themed protesters march down Bourbon Street in the French Quarter of New Orleans, Louisiana, on May 25, 2019, to protest the proposed Heartbeat Bill that will ban abortion after 6 weeks in that state scheduled for a vote on May 28. (Photo by Emily KASK / AFP) (Photo credit should read EMILY KASK/AFP/Getty Images) EMILY KASK AFP/Getty Protests across US after abortion laws enforced Missouri Thousands of demonstrators march in support of Planned Parenthood and pro-choice as they protest a state decision that would effectively halt abortions by revoking the license of the last center in the state that performs the procedure, during a rally in St. Louis, Missouri, May 30, 2019. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images) SAUL LOEB AFP/Getty Protests across US after abortion laws enforced Missouri TOPSHOT - Thousands of demonstrators march in support of Planned Parenthood and pro-choice as they protest a state decision that would effectively halt abortions by revoking the license of the last center in the state that performs the procedure, during a rally in St. Louis, Missouri, May 30, 2019. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images) SAUL LOEB AFP/Getty Protests across US after abortion laws enforced Missouri Pro-choice supporters and staff of Planned Parenthood hold a rally outside the Planned Parenthood Reproductive Health Services Center in St. Louis, Missouri, May 31, 2019, the last location in the state performing abortions, after a US Court announced the clinic could continue operating. - A US Court on May 31, 2019 blocked Missouri from closing the clinic. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images) SAUL LOEB AFP/Getty Protests across US after abortion laws enforced Washington, DC Abortion rights activists rally in front of the US Supreme Court in Washington, DC, on May 21, 2019. - Demonstrations were planned across the US on Tuesday in defense of abortion rights, which activists see as increasingly under attack. The "Day of Action" rallies come after the state of Alabama passed the country's most restrictive abortion ban, prohibiting the procedure in all cases, even rape and incest, unless the mother's life is at risk. Alabama is among about 14 states which have adopted laws banning or drastically restricting access to abortion, according to activists. (Photo by Andrew CABALLERO-REYNOLDS / AFP) (Photo credit should read ANDREW CABALLERO-REYNOLDS/AFP/Getty Images) ANDREW CABALLERO-REYNOLDS AFP/Getty Protests across US after abortion laws enforced Georgia ATLANTA, GA - MAY 21: Heather Masson, left, and Victoria Jernigan hold signs promoting a woman's right to choose during a protest against recently passed abortion ban bills at the Georgia State Capitol building, on May 21, 2019 in Atlanta, Georgia. The bill would ban abortion when a fetal heartbeat is detected. The Alabama abortion law, signed by Gov. Kay Ivey last week, includes no exceptions for cases of rape and incest, outlawing all abortions except when necessary to prevent serious health problems for the woman. Though women are exempt from criminal and civil liability, the new law punishes doctors for performing an abortion, making the procedure a Class A felony punishable by up to 99 years in prison (Photo by Elijah Nouvelage/Getty Images) Elijah Nouvelage Getty Protests across US after abortion laws enforced Alabama Cristina Castor (L) and Julian Kersh pose for a portrait in Ingram Park in Birmingham, Alabama, May 19, 2019 during the March for Reproductive Freedom. - "If this goes all the way and flips Roe v Wade at that point it just seems like where is this going to stop," Kersh said. The state of Alabama passed a near-total abortion ban on May 14, 2019 making it the most restrictive law in the United States. (Photo by Seth HERALD / AFP) (Photo credit should read SETH HERALD/AFP/Getty Images) SETH HERALD AFP/Getty

After she was prosecuted in July 2017, she served 33-months behind bars.

But now a judge has overturned her sentence on appeal, citing lack of evidence. Her lawyer Bertha DeLeon said on Monday that she had been found not guilty.

Prosecutors nonetheless demanded a retrial and requested she serve 40 years.

Paula Avila Guillden, from the Women’s Equality Center, is one of the many activists who has worked with Evelyn Hernández during the trial.

“Justice for Evelyn was delayed and denied for far too long”, she said. “But today the courts have determined what we already knew to be true: Evelyn is innocent.”

El Salvador has had a total ban on abortion since 1998, including in cases of rape or incest. More than 20 women are currently in prison under charges of manslaughter, homicide, or aggravated homicide after being accused of having an abortion, according to the Women’s Equality Center.