Ecuador's high court has decriminalised abortion in cases of rape, a major step in the traditionally Catholic country.
The Constitutional Court voted 7-2 in favour of declaring two articles of the penal code unconstitutional.
The decision came in response to a petition from women's rights groups, and paves the way for parts of the legislation to be changed.
Abortion remains a deeply divisive issue in Latin America, where countries have strict laws banning terminations.
The only places where abortions are currently legal in the region are Argentina, Uruguay, Cuba, Guyana and parts of Mexico.
But terminations are allowed in cases of rape in several countries, including Bolivia, Brazil, Chile, Colombia and Panama, according to the advocacy group Center for Reproductive Rights.
Ecuador's current legislation allows abortion only when the mother's life is in danger or after the rape of a woman with a mental disability. With the court ruling, abortion in all cases of pregnancy resulted from rape has been decriminalised.
Analysts say the court can now demand the National Assembly reform the articles declared unconstitutional. In 2019, the assembly voted against decriminalising abortion in all cases of rape and foetal abnormalities, amid strong opposition of the influential Roman Catholic Church.
Pro-choice activists celebrated outside the Constitutional Court building in the capital, Quito. Ecuador's National Coalition of Women, a human rights group, said it was a "historic" day but that it would continue "to fight" for abortion to be legal in all circumstances.
Lolo Miño, one of the country's best known women's rights activists, said on Twitter (in Spanish): "I'm crying as I write this because I don't believe it! Today, girls and women who are the victims of rape in Ecuador have a second chance."
There were also some demonstrations from anti-abortion activists, who criticised the vote. The bishops' conference of Ecuador expressed concern in a letter to the head of the Constitutional Court.
Women undergoing terminations in Ecuador face up to three years in jail. Because of the restrictions, women and girls seek illegal and unsafe abortions, which can lead to health complications and death.
Between 2008 and 2018, about 20,000 girls under 14 - the age of consent in Ecuador - gave birth in the country, according to rights group Fundación Desafío. And a quarter of all pregnancies of those aged between 15 and 19 were a result of rape, the group said.
Meanwhile, 11 women report cases of rape on average every day nationwide.
President-elect Guillermo Lasso, a conservative Catholic and a pro-life advocate who takes office on 24 May, said he had "full respect" for the ruling. "The independence of the government branches and the secular nature of the state are principles that cannot be negotiated," he said in a statement.
Across Latin America, there has been increased pro-choice campaigning, known as the "green wave", based on the colour worn by protesters. In January Argentina, one of the most influential countries in the region, legalised abortion up to the 14th week of pregnancy.
Some other countries have banned abortions entirely. Among them are Nicaragua, El Salvador and Honduras, where parliament gave its initial approval to a bill that would make it virtually impossible to legalise abortion.