Argentina's senate has rejected a bill which would have legalised abortion in the first 14 weeks of pregnancy.
After a marathon debate, 38 senators voted against it and 31 in favour. Its defeat means lawmakers must wait until next year to resubmit legislation.
Currently abortion is allowed in Argentina only in cases of rape, or if the mother's health is in danger.
Demonstrators on both sides of the debate rallied outside parliament as voting took place.
Anti-abortion activists have been jubilant. "What this vote showed is that Argentina is still a country that represents family values," one told the Reuters news agency.
But pro-choice campaigners, many of them dressed in green to show their support for the cause, were seen crying and comforting each other. Some started fires and lobbed missiles at police.
Pro-choice campaigners have for years tried to get bills passed in Argentina, where the population is overwhelmingly Roman Catholic.
Their efforts gained new impetus when President Mauricio Macri – who opposes abortion – called on Congress to consider a vote on it, and it narrowly passed in the lower house.
For the bill's advocates, legalising abortion is a matter of public health, with 43 women thought to have died last year after receiving illegal abortions.
"Women perform abortion with criminalisation or without it," lawyer and campaigner Sabrina Cartabia Groba said.
But a campaigner against abortion, Camila Duro, argued such deaths could be avoided without legalising the practice.
"The message that we wanted to put across is that abortion equals social failure. For a woman to resort to it, many other things need to have failed first."
Among Latin American nations only Uruguay and Cuba have fully decriminalised abortion.