Lawmakers in Pope Francis' native Argentina have narrowly approved a bill to legalise abortion during the first 14 weeks of pregnancy.

Thousands of abortion rights activists cheered and hugged outside Congress Buildings as the lower house, the Chamber of Deputies, passed the bill by 129 votes to 125. The bill now goes before the country's Senate.

The vote took place after the parliamentary deliberations on the measure had dragged into a second day. Lawmakers debated through the night and into the morning, with nearly all 257 Deputies having their say.

The debate has divided Argentine society. Though it became the first Latin American country to legalise same-sex marriage in 2010, it remains strongly influenced by the Catholic Church and by its native son, Pope Francis.

"Our women are out there, they're waiting for us, they're waiting for us to rise to the occasion," said Magdalena Sierra of the centre-left Front for Victory party.

Luis Pastori, of the Radical Civic Union, said it was "absurd and unjust to sanction a law that enables the killing of human beings that must be respected from the moment of conception."

The Catholic Church has campaigned fiercely against the new bill and before the vote, Pope Francis had written to the Argentine bishops calling on them to "defend life and justice."

As well as decriminalising abortion during the first 14 weeks of pregnancy, the bill also allows terminations where the fetus suffers from conditions not compatible with life outside the womb.

Eight years ago, Argentina overcame strong church opposition to legalising gay marriage, but until this week, the issue of abortion had not been discussed in parliament.