A woman jailed for murder under El Salvador's strict abortion laws has had her 30-year sentence commuted.
Teodora Vásquez, 35, spent 10 years in jail after her baby was found dead and she was sentenced for murder.
Her release came as a surprise as her appeal against her sentence was rejected in December.
El Salvador's Supreme Court said there were "powerful reasons of justice and fairness which warranted granting her the grace of commuting her sentence".
Ms Vásquez has always maintained her innocence, saying that she called an ambulance when she had abdominal pains late in her pregnancy and then passed out.
By the time she regained consciousness, her newborn was dead and she was surrounded by police, she says.
She was detained in July 2007 and sentenced in February 2008.
Complete ban on abortions
El Salvador is one of a handful of countries in the world where abortions are completely banned and carry heavy sentences.
The punishment is up to eight years in jail but in many cases in which the foetus or newborn has died, the charge is changed to one of aggravated homicide, which carries a minimum sentence of 30 years.
Ms Vásquez's was one of those cases and she was sentenced to 30 years in 2008.
Her appeal in December 2017 was heard by the same judges who had originally sentenced her and the 30-year jail term was confirmed despite pressure from human rights groups.
It is not clear when the Supreme Court took the decision to commute her sentence but it is not the first time El Salvador's highest court has taken such a decision.
In 2005, it reduced Isabel Cristina Quintanilla's 30-year-sentence to three years. Ms Quintanilla had been jailed under very similar circumstances to Ms Vásquez.
While El Salvador is not alone in Latin America in having a total ban on abortions, the country is particularly strict in the way it enforces it.
Doctors have to inform the authorities if they think a woman has tried to end her pregnancy. If they fail to report such cases, they too could face long sentences in jail.
The result is what human rights groups are calling a criminalisation of miscarriages and medical emergencies, with more than 100 convicted of abortion-related crimes in El Salvador since 2000.