Argentina’s Senate voted against legalizing elective abortion in the early hours of Thursday morning, dashing the hopes of pro-abortion rights advocates in the predominantly Catholic country, homeland of Pope Francis.

The Senate rejected the proposed bill 38 to 31, with two abstentions and one absentee.

The bill, which fueled contentious debate, would have expanded abortion rights to allow women to end a pregnancy in the first 14 weeks. Current laws allow the procedure only in cases of rape, or when the mother’s health is at risk.

A heavy police presence around the National Congress in Buenos Aires quickly quelled scattered confrontations after the vote’s outcome was announced.

Opposition mounted ahead of the vote in Argentina’s more conservative Senate after the legislation only narrowly passed through the lower house of Congress in June. And the bill lost momentum over the weekend when an opposition senator withdrew her support.

Activists in favour of the legalization of abortion comfort each other outside the National Congress in Buenos Aires.

Celia Szusterman, trustee of the UK board of Pro-Mujer and director of the Latin America program at the Institute for Statecraft, told CNN that is was “a step backward for women’s rights and women’s health.”

She says it’s a “sad day… not only because of the way the vote went but the way the campaign for and against went. It was so divisive.”

Protesters demonstrate in support of loosening the abortion law, left, and against abortion, right, in this photo taken from Congress where lawmakers were debating the issue.

But even with its defeat, the groundswell of support for the legislation is not expected to go away, with those who supported the bill saying it was a victory that it was even debated.

Activists say they’ll keep pushing the bill, in the hope that it passes one day soon.

“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,” Szusterman said.

The bill has ignited passions and sparked widespread protests in Argentina, with anti-abortion campaigners protesting in the streets under blue “save both lives” banners and members of the opposing side in the debate donning green bandanas.

As senators debated the bill into the early hours of Thursday morning, pro-abortion rights activists rallied outside Congress chanting “legal abortion at the hospital” while the Catholic Church held a “Mass for Life” in the capital Buenos Aires.

Pro-choice activists hold a poster of a woman who died as a result of a clandestine abortion.

In recent weeks the so-called “green wave” demonstrations have spread outside of Argentina too. Green bandanas — now a symbol of the abortion rights movement — have been spotted in Brazil, where the country’s supreme court is considering loosening abortion restrictions. And momentum is growing in Chile, where lawmakers voted last year to ease the country’s strict ban.

Supporters of the bill rallied across the region Wednesday, in Chile, Uruguay, Mexico and Peru, as well as across the Atlantic, in Spain.

An activist in favour of the legalization of abortion holds a sign reading “Take out your Rosaries from our ovaries” during a demonstration outside of Argentina’s embassy in Santiago de Chile.

Bolstered by Ireland’s referendum in May, which removed one of Europe’s last abortion bans, pro-abortion rights activists were hoping they could turn the tide on abortion law in Latin America, where more than 97% of women of reproductive age live in countries with restrictive abortion laws. On Tuesday, 60 Irish parliamentarians, across political parties and groups, signed a letter to the Argentinian senators urging a vote in favor of the bill.

While Pope Francis hasn’t addressed the legislation directly, he did speak out strongly against abortion just days after the bill was approved by the lower house — comparing abortion to avoid birth defects to Nazi eugenics.

The pontiff also issued a letter in March, as the abortion debate began, urging Argentines to “make a contribution in defense of life and justice.”