Argentina became the first major country in Latin America to legalize abortion when the Senate voted early on Wednesday to allow it through the 14th week of pregnancy, in the face of opposition from the influential Catholic Church.
The fiercely contentious vote - passed with 38 in favor, 29 against and one abstention - came after a marathon debate that began at 4 p.m. (1900 GMT) on Tuesday.
As the result was read out, a crowd of thousands erupted in cheers outside the Senate building in Buenos Aires, waving the green flags that represented their campaign as green smoke rose above the crowd.
"We did it sisters. We made history. We did it together. There are no words for this moment, it passes through the body and the soul," tweeted Monica Macha, a lawmaker with President Alberto Fernandez' centre-left ruling coalition which supported the law.
The ruling could set the tone for a wider shift in conservative Latin America where there are growing calls for greater reproductive rights for women.
Across the region, abortions are available on demand only in Communist Cuba, comparatively tiny Uruguay and some parts of Mexico.
"Adopting a law that legalizes abortion in a Catholic country as big as Argentina will energize the struggle to ensure women's rights in Latin America," said Juan Pappier, a senior Americas researcher at Human Rights Watch.
"Although there will certainly be resistance, I think it's fair to predict that, as it occurred when Argentina legalized same sex marriage in 2010, this new law could have a domino effect in the region."
Until now, Argentine law has only allowed abortion when there is a serious risk to the health of the mother or in cases of rape.
Pro-choice groups argue that criminalising abortion harms women from the most vulnerable groups who they say are instead often forced to seek dangerous illegal abortions.
Argentina's powerful Catholic church argues the practice violates the right to life. Argentina is the birthplace of Pope Francis.
A change in the law was narrowly defeated in a Senate vote in 2018 after being approved in the lower house, but the latest bill was the first to have the backing of the ruling government.