The lower house of Argentina's congress voted to legalize abortion on Friday, sparking street celebrations by activists but the legislation faces an uphill battle in the Senate, which rejected a similar bill two years ago.

The announcement drew cheers from thousands of young people in green scarves -- an emblem for the campaign for legal abortions -- who had spent the night outside the congress building in Buenos Aires.

Protesters in blue scarves, who oppose the change, were separated from the others by a fence, and greeted the result with disappointment.

The legislation, which would allow abortion until the 14th week of pregnancy, passed by 131 votes to 117 with six abstentions, the secretary of the Chamber of Deputies report after a 20-hour session of debate.

In Argentina, abortion is allowed only in the event of rape or danger to the mother's life, under legislation dating back to 1921.

Center-left President Alberto Fernandez presented the proposal this year as a way to "guarantee that all women have access to the right to comprehensive health."

The Senate is now expected to take up the bill on December 29, ruling party Senator Norma Durango told El Destape radio.

"This time we have a chance to get the bill passed in the Senate," she said.

Although the Frente de Todos ruling coalition has 41 of the 72 seats in the upper house, the vote hangs in the balance because lawmakers are not expected to vote along party lines.

"There are some undecideds," said Durango.

The issue of legalizing abortions dominated the Argentine political agenda in 2018, when it made it to congress amid huge demonstrations in the majority-Catholic country which is the birthplace of Pope Francis.

Women in green scarves celebrate outside the Argentine Congress after the lower house passed a bill to legalize abortion
Women in green scarves celebrate outside the Argentine Congress after the lower house passed a bill to legalize abortion AFP / RONALDO SCHEMIDT

Back then, it also got the approval of the Chamber of Deputies, but was rejected in the Senate. Both houses underwent a reshuffle after the 2019 general elections.

"I am Catholic but I have to legislate for everyone," President Fernandez declared Thursday. "It is a very serious public health issue."

"Abortion is legal in first-world countries and other developed countries that are very religious, such as Italy, Spain and Ireland," said health minister Gines Gonzalez Garcia.

"Now we are moving forward in Argentina. If this were a masculine problem it would have been resolved a long time ago," said the minister.

Health analysts estimate that between 370,000 and 520,000 clandestine abortions are performed annually in Argentina, according to government statistics.

And these back-alley procedures have led to some 3,000 deaths since 1983, said the president.

"The debate is not about whether or not to allow abortions. It is about whether or not to allow safe abortions," said Ana Carolina Gaillard, a lawmaker with the ruling party.

Outside the congress building, women in green scarves were jubilant.

"We believe that women have a right to decide what to do with their bodies," Melisa Ramos, 21, told AFP before the vote. "Lawmakers who vote against legalization should know that on their hands will be the blood of the women who die in clandestine abortions."

On the other side of the fence, protesters who oppose abortion chanted "Save both lives!" and held up baby dolls smeared red to look bloody.

If the bill passes the Senate, Argentina would join Cuba, Uruguay and Guyana as countries allowing abortion in Latin America. It is also legal in Mexico City.