Ecuador's parliament on Thursday passed a law that will permit abortions after a rape.
The new law will allow all women over 18 who have been raped to have abortions up to the 12th week of pregnancy, while girls and rural or indigenous women will be able to terminate a pregnancy up to the 18th week in cases of rape.
The move comes after an order from Ecuador's Constitutional Court last year to decriminalize abortion after rape.
Lawmakers passed the law in a second attempt, with 75 voting in favour, 41 against and seven abstaining. The first proposal had sought to legalize abortion after rape up to the 16th week overall, but failed to pass.
"We women over 18 sacrificed ourselves for the girls who were raped," lawmaker Johanna Moreira, who was behind the initiative, said of the eventual compromise.
Until now, Ecuador has only allowed abortion in special cases, such as after the rape of women with mental disabilities or if the mother's life is in danger.
In other cases, those who terminate pregnancies can face up to two years in prison.
Ecuador's President Guillermo Lasso, a staunch Catholic, has yet to approve the law, but has expressed he is willing to follow the Constitutional Court's decision.