Argentina’s Senate voted Wednesday to legalize elective abortion, a dramatic shift in the birthplace of Pope Francis and in a region with some of the world’s most restrictive antiabortion laws.

The closely watched vote was seen as a hard-fought victory not just for abortion rights advocates in the predominantly Roman Catholic country but across Latin America, where advocacy groups are campaigning with varying degrees of success to replicate the effort. Those groups include Salvadorans attempting to upend decades-long prison sentences for women who terminate a pregnancy and Colombians and Mexicans who have launched campaigns to decriminalize the procedure.

“The movement in Argentina has been an inspiration,” said Erika Guevara-Rosas, the Americas director at Amnesty International. “As we become more progressive societies, where the Catholic Church wields less power, these movements create an opportunity for states to acknowledge that abortion is a human right.”

When President Alberto Fernández signs the legislation, Argentina will become the largest nation in Latin America to allow elective abortion. The procedure is legal in Cuba, Uruguay, Guyana and parts of Mexico. But across much of the region, abortion rights advocates have come up against conservative religious groups and political parties.

“Six countries in the region still prohibit [abortion] without exception,” said Catalina Martínez, regional director for Latin America and the Caribbean at the Center for Reproductive Rights. “This causes Latin America to be the only region in the world where pregnancies in children under 14 years of age continue to increase and where the highest number of deaths related to unsafe abortions are also recorded.”

In Argentina, the vote followed years of debate and demonstrations. The bill that was approved Wednesday, which will allow abortion during the first 14 weeks of pregnancy, was the ninth in the past 15 years to address the country’s abortion laws. At present, the procedure is permitted only in cases of rape, incest or to save the life of the mother.

“Abortion, safe, legal and free, is law,” Fernández tweeted after the Senate vote.

A similar proposal passed Argentina’s House of Deputies in 2018 but failed in the Senate. This time it had the support of Fernández, who won office last year in part on promises to push it through. He described it as a matter of public health.

“The debate is not saying yes or no to abortion,” he said in November. “The dilemma that we must overcome is whether abortions are performed clandestinely or in the Argentine health system.”

Analysts and advocates across the region saw the bill’s passage as evidence that social change is possible, even in a conservative nation.

“Here in El Salvador we have women still in prison for terminating their pregnancies, teenagers accused of abortion who are being charged in court,” said Morena Herrera, a prominent activist in the Central American country. “The need to change legislation is urgent and what happened in Argentina gives us more power, it makes us feel vindicated, it proves that social change is possible.”

Mexico’s Supreme Court rejected a bid to decriminalize abortion in July. President Andrés Manuel López Obrador, considered a leftist on economic issues, has rarely spoken about the issue in public.

“We shouldn’t open these debates,” he said in 2019, hinting at the divisive nature of the issue even among his base.

Colombia’s constitutional court weighed the legality of elective abortion in March, ultimately choosing to keep restrictive laws in place.

“It did not get a majority of votes, but at least it was discussed,” said Cristina Rosero Arteaga, a lawyer at the Center for Reproductive Rights in Colombia.

In Chile, legislation similar to the Argentine bill was introduced in Congress two years ago but was not debated.

“What happened in Argentina is relevant to resume what we started in 2018,” said Camila Maturana, a legal consultant to the feminist studies center Corporación Humanas. “They have set an example for the green tide in the region. It shows that the mobilization of women can expand the frameworks of democracies.

In Argentina, the pull of the Catholic Church remained strong. Francis, a former archbishop of Buenos Aires who remains deeply influential in his native country, has described abortion as a question of “human ethics.”

“Is it fair to eliminate a human life to solve a problem?” he asked in a letter to supporters made public last month.

Antiabortion activists took that message to the streets.

Viviana Canosa, a journalist and antiabortion activist, joined fellow opponents on Monday, the Catholic Feast of the Holy Innocents, to oppose the legislation.

“We hope the senators will vote with their hearts, with conviction, and in favor of the motherland,” she said in a video shared on her Twitter account.

But those activists were vastly outnumbered by women wearing green face coverings and waving green flags. Supporters cheered when the senate capped a 12-hour debate with a 38-to-29 vote to approve the measure.

Several lawmakers changed their vote from 2018.

“I learned a lot in these two years,” said Silvina García Larraburu, who voted against the bill in 2018 but supported it this time. “I am the same senator, who at this time decided to continue listening and analyzing different situations.”

Silvia Elías de Pérez, a senator who opposed the bill, said Fernández was “personally pressuring senators” to pass the bill.

“If the bill becomes law, we will go to court to have it declared unconstitutional,” she told reporters.

Feminist groups said the legislation was about safety and equality.

“Senators should never play politics with the lives of women and girls in Argentina,” Paula Ávila-Guillen, executive director of the Women’s Equality Center, said in a statement. “It’s no secret that our backwards and outdated abortion laws are not deterrents, in fact they exacerbate the problem by leading to unsafe clandestine abortions that threaten the health and lives of the most vulnerable women and girls.”

Health Minister Ginés González García said last month that more than 3,000 women have died in Argentina since the early 1980s as a result of underground abortions.

Even with the bill’s passage, said Marta Alanis, founder of Catholics for the Right to Decide, opponents “will make every effort to prevent” women from getting abortions.

“A woman deciding to get an abortion is the thing conservatives can’t tolerate.”