Senators in Pope Francis’s native Argentina voted against a bill that would have legalized abortion on demand until week 14 of a pregnancy early Thursday morning, following a marathon session that came as the latest twist in a three-month national debate marked with massive public rallies both in favor and against the measure.

The final tally in Argentina’s Senate was 38 votes again the measure, with 31 in favor. Two senators abstained from voting, and one other was absent.

Although the result means the legalization bill cannot be debated again until 2019 at the earliest, some proponents of relaxing Argentina’s strict anti-abortion laws have floated the idea of a separate decriminalization measure as a compromise solution.

The result had been expected after the 38 senators announced their “no” vote ahead of the Wednesday/Thursday session, defined by local media as “historic.”

Pro-abortion rights groups had issued threats of “burning down churches” ahead of the vote, leading the national government to protect church buildings. Among other measures, security forces barricaded the cathedral in the national capital where Francis used to say Mass when he was Archbishop of Buenos Aires, along with many other historic churches in the area close to the halls of Congress.

Argentine President Mauricio Macri announced in March that despite being personally against abortion, he would allow Congress to debate a bill to legalize it. It’s the first time in over a decade that abortion was discussed at a parliamentary level in Francis’s home country.

The procedure is currently criminalized in the country with three exceptions: When the pregnancy was result of a rape, when the life of the mother is at risk, or when the baby is considered inviable outside the womb.

However, several reports during the months leading to the vote pointed out that no woman nor medical practitioner is currently serving a sentence due to a clandestine abortion.

When he made the announcement in March, Macri vowed that the federal government would stay out of the debate. However, his health minister lobbied on national television for the bill to pass and addressed both the Senate and the Chambers of Deputies during a series of public hearings.

Minister Adolfo Rubinstein said several times that unsafe abortion is the leading cause of maternal death in Argentina, in an attempt to present abortion as a health emergency. However, his own ministry discounted that claim: According to ministry statistics, in 2016 almost seven times more women died in Argentina in childbirth (213) than as a result of an abortion (31). The latter number represents deaths resulting from both legal and illegal abortions.

This erroneous information was picked up by Amnesty International, which, on the eve of the vote, published a back-page ad in the New York Timesshowing a hanger, allegedly used in clandestine abortions, saying that unsafe abortions are the leading cause of maternal deaths in Argentina. The ad also included the line: “The world is watching.”

International Planned Parenthood Federation, which finances several of the pro-abortion groups in Argentina, including a clinic that openly promotes the illegal procedure, also tried to influence senators with a series of tweets that circulated arguments given by Rubinstein.

On the day of the vote, hundreds of thousands of demonstrators from both camps took to the streets around congress, with police officers keeping each side divided, in vigils that began early in the day and lasted until the votes were cast.

With the square in front of the building serving as a ‘no man’s land,’ aerial pictures captured the streets filling up, with colors identifying each cause: On the one side, light-blue and white, representing both the color of the pro-life campaign and the national flag. On the other, green dominated, but banners of several socialist political organizations were also visible.

Pictures on social media showed those on the first side sharing several messages with a religious undertone, while on the opposite side the messages were anti-clerical, such as a woman holding a sign that read,  “The woman decides, society respects, the state guarantees and the Church doesn’t give an opinion.”

Over the weekend, some 650,000 people rallied in Buenos Aires in opposition to the legalization measure, convoked by Evangelical churches and with the support of many Catholic bishops. In addition, on Sunday rallies were organized in over 100 cities for what was described as a “Federal Rally.”

Before Wednesday, the last large manifestation of those in favor of the bill was on June 14, when the bill was passed in the Chamber of Deputies.

As the senators were still debating the bill, Cardinal Mario Poli, who succeeded Francis in the archdiocese of Buenos Aires, celebrated a Mass at the  cathedral, which is about half a mile from congress.

For months, Poli said in his homily, arguments in favor and against the bill were heard, and the only ones “who didn’t have an opportunity to make themselves heard are the human beings fighting to be born.”

Protecting life, he added, is a “humanitarian cause,” as it is the first human right and the first duty of the State: “For the first time in Argentina’s history, they’re trying to legitimize the elimination of a human being by another human being.”

The bill being debated, he said hours before the results came in, would “legalize the death of an innocent person, excluding their right to a legitimate defense, without trial or due process. The heart and reason rebel against such an injustice, because the unborn have the right to participate in this nation, where there’s place for everyone and no one is unnecessary.”

Quoting Francis’s apostolic exhortation Evangelii Gaudium, Poli said that “it is also true that we have done little to adequately accompany women in very difficult situations, where abortion appears as a quick solution to their profound anguish, especially when the life developing within them is the result of rape or a situation of extreme poverty.”

Among the concelebrants was the papal representative in the country, Archbishop Léon Kalenga Badikebele.

During the debate, Francis remained quiet, delivering several remarks against abortion, but never directly referring to what was happening in Argentina. However, on Wednesday morning Rome time, during his weekly Wednesday audience, a group of Argentine pilgrims had a light-blue flag on display, with the motto of the pro-life campaign, “Let’s save both lives,” and the pope was seen giving a blessing to the group.

Macri’s decision to open the debate, despite having stated during the campaign that he wouldn’t, could have a high political cost for the center-right politician as many members of his base are middle-class Catholics. The hashtag #ConAbortoNoTeVoto, which translates to “I won’t vote [for] you with abortion,” was a trending topic on Twitter during the weekend.

Throughout the debate the bill was heavily criticized by lawyers and legislators who noted that abortion is not only considered a crime in the penal code, but it’s also against Argentina’s constitution, which calls for the protection of life from conception until natural death.