Argentina’s senators on Thursday rejected a bill that would have allowed women in the country to get an abortion in the first 14 weeks of their pregnancy, CNN reported. Argentina is a predominantly Catholic country and is also the homeland of Pope Francis.

Thirty-eight senators voted against the legislation and 31 voted for it, with two members abstaining and one absent, after a debate that lasted for more than 16 hours. Currently, abortion in the South American nation is only allowed in cases of rape or if it endangers the mother’s health.

Uruguay and Cuba are the only two countries in Latin America to have decriminalised abortion. In Brazil, the Supreme Court is hearing cases on whether abortion should be legalised up to 12 weeks, reported the BBC.

Police were deployed in large numbers around the National Congress in Buenos Aires, working to curb any disturbance as the debate went on. While abortion-rights activists chanted “legal abortion at the hospital”, the Catholic Church held a “Mass for Life”, said the CNN.

After the result was announced, anti-abortion demonstrators clad in blue, which is the colour of the “save both lives” movement, danced and set off fireworks outside the building. A few supporters of abortion rights threw missiles and rocks at police, who retaliated by firing tear gas and water cannon.

“What this vote showed is that Argentina is still a country that represents family values,” anti-abortion activist Victoria Osuna told Reuters.

Celia Szusterman, trustee of the UK board of Pro-Mujer and director of the Latin America programme at the Institute for Statecraft, told CNN that the vote was “a step backward for women’s rights and women’s health”. Pro Mujer is an NGO working to bring health and education programmes to low-income women in Latin America.

“This bill did not solve anything,” The New York Times quoted Senator Olga Inés Brizuela y Doria as saying. “We have to go to the causes of abortion and not abortion as a solution.”

While abortion-rights campaigners seemed to have a chance of success a few weeks ago, leaders of the Catholic Church spoke out against abortion, leading to senators from conservative provinces to vote against it, reported The New York Times.

Pope Francis has not addressed the legislation directly. But in June, he said getting an abortion to avoid birth defects is similar to Nazi eugenics programmes. “Children should be accepted as they come, as God sends them, as God allows, even if at times they are sick,” he said. “In the last century the whole world was scandalised by what the Nazis did to pursue the pureness of the race. Today, we are doing the same thing, with white gloves.”

In March, when the abortion debate began, he had issued a letter urging Argentines to “make a contribution in defense of life and justice.”

Even after the defeat, activists said they would continue to push for the bill, according to CNN. “It will happen because that’s the world – to increase rights and this is one of the fundamental rights that is still not available to women in Latin America,” said Szusterman.