Argentine senators on Thursday voted against legalising abortion in the homeland of Pope Francis, dashing the hopes of women's rights groups after the bill was approved by the legislature's lower house in June.
The vote, with 38 against, 31 in favor and two abstentions, capped a marathon session that began the day before and stretched into the early hours of Thursday before its final conclusion.
Fireworks and shouts of joy erupted among anti-abortion activists camped outside Congress, while pro-choice campaigners, many decked in the green scarves that had come to symbolise their movement, were downcast.
Some burnt garbage and wooden pallets and threw stones at riot police, who attempted to disperse them with tear gas and water cannon.
The vote followed a referendum in Ireland, another traditionally Catholic country, in May that paved the way to legislate for the termination of foetus. It also came after months of fiercely polarised campaigns on the hot-button issue.
The bill was passed by Congress's lower house in June by the narrowest of margins, but was widely expected to fall short of the votes needed to pass in the Senate.
Lawmakers must now wait a year to resubmit the legislation.
Miguel Angel Pichetto, a Peronist opposition leader in the Senate, said pro-abortion campaigners would not be giving up.
"The future does not belong to the "No" campaigners. Sooner rather than later, women will have the decision they need, sooner rather than later we will win this debate," he said in his closing speech.
Earlier in the day, scores of buses had brought people from around the country into Buenos Aires for the duelling rallies outside Congress.
Abortion rights supporters wore green scarves while anti-abortion activists donned baby blue. A partition was set up to keep them separated.
Currently, abortion is allowed in Argentina in only three cases, similar to most of Latin America: rape, a threat to the mother's life or if the foetus is disabled.
The bill had sought to legalise abortion during the first 14 weeks of pregnancy and would have seen Argentina join Uruguay and Cuba as the only countries in Latin America to fully decriminalise abortion.
It's also legal in Mexico City. Only in the Central American trio of El Salvador, Honduras and Nicaragua does it remain totally banned.
The prospect of legalisation had energised women's groups and still retains a huge support from citizens.
Rallies took place around the world in front of Argentine diplomatic missions, mainly in support of the bill.
"Nobody forces you to have an abortion. Don't force me to give birth," read one pro-abortion slogan.
One abortion rights protester in Buenos Aires, 20-year-old Celeste Villalba, said keeping abortions illegal would not prevent them from happening.
"This debate is whether it should be legal or done in secret. It's not about being in favor of abortion or not," she said.
Various charities estimate that 500 000 illegal, secret abortions are carried out every year in Argentina, resulting in around 100 deaths.
Opponents of abortion meanwhile held their own demonstrations.
Priests and nuns were joined by rabbis, imams and members of other Christian churches to oppose the bill.
One of them, Federico Berruete, a 35-year-old priest, joined anti-abortion demonstrators holding up slogans reading "Life starts at conception."
With such division in the country, one lawmaker from the ruling party, Daniel Lipovetzky, suggested that the matter might end up being put to a referendum.
"It's possible that we propose that," he said.
Ireland ended up overturning its own constitutional ban on abortion through a referendum held in May. That dealt a hammer blow to the Catholic Church, which is as revered in Ireland as it is in Argentina.
In mid-June, Argentina's lower house voted in favor of the bill by just 129 to 125, thanks in part to the anti-abortion President Mauricio Macri's insistence on pushing the bill through the legislature.