Argentina Wednesday became one of only a handful of South American nations to legalize abortion, after hours of debate in the Senate.

Hundreds of thousands of illegal abortions are carried out every year in the nation of 44 million, and pro-choice campaigners have long-urged authorities to put an end to dangerous backstreet terminations by legalizing the process.

“It becomes law,” said Senate president Cristina Kirchner, after more than twelve hours of debate.

Thousands of pro-choice activists cheered in the streets of the capital after the bill was approved 38 to 29, with one abstention.

It legalizes voluntary abortions at any stage up to 14 weeks of pregnancy.

Ahead of the vote, pro-choice and anti-abortion demonstrators had gathered outside parliament despite coronavirus fears.

“This fight was born in the streets,” Silvia Saravia, a pro-choice activist, told AFP.

The vote overturns a similar one in 2018 which, although also passed the lower house, ultimately foundered in the Senate by 38 votes to 31.

South America has some of the most restrictive abortion laws in the world. In Argentina, terminations were allowed in only two instances: rape, and danger to the mother’s life.

The bill was proposed by President Alberto Fernandez and passed the Chamber of Deputies on December 11, despite fierce opposition from the Catholic Church and evangelical Christians.

“I’m Catholic but I have to legislate for everyone. Every year around 38,000 women are taken to hospital due to (clandestine) abortions and since the restoration of democracy (in 1983) more than 3,000 have died,” said Fernandez.

“The interruption of a pregnancy is a tragedy. It abruptly ends another developing life,” said Ines Blas, a senator from the ruling coalition.

However, Senator Silvina Garcia Larraburu, again from the ruling coalition, said she would vote for the bill this time despite voting against it in 2018.

Despite measures to prevent the spread of the coronavirus pandemic, thousands demonstrated in front of parliament, following the debate on giant screens.

Pro-choice activists have campaigned for years to change the abortion laws that date from 1921, adopting a green scarf as their symbol.

Anti-abortion activists had recently started wearing light blue scarves.

“I know that in the heart of every senator there is love for their children, their grandchildren, and above all a hope that children give us,” said anti-abortion protester Karina Muzaquio.

Outside Congress, anti-abortion demonstrators raised crucifixes, prayed and set up displays that simulated tombs, around a giant graphic image of a baby stained with blood.

Across the plaza, pro-choice protesters held signs that reading: “We will never go underground again.”

Earlier Wednesday Pope Francis, who is Argentine, tweeted: “The son of God was born discarded to tell us that every person discarded is a child of God.”

While not explicitly mentioning the vote, his comment was interpreted by many as encouraging the senators to vote against the bill.

Such changes have always been slow in Argentina: divorce was legalized only in 1987, sex education introduced in 2006, gay marriage approved in 2010 and a gender identity law passed in 2012.

In Latin America, abortion is only legal in Cuba, Uruguay and Guyana, as well as Mexico City.

In El Salvador, Honduras and Nicaragua, it is banned, and women can be sentenced to jail even for having a miscarriage.