Fireworks and shouts of joy erupted among anti-abortion activists camped outside Congress, while pro-choice campaigners, many decked in the green scarves that had come to symbolize their movement, were downcast (AFP Photo/ALBERTO RAGGIO)

Argentina's senators on Thursday voted against legalizing abortion in the homeland of Pope Francis, dashing the hopes of women's rights groups after the bill was approved by the legislature's lower house months earlier.

The vote, with 38 against, 31 in favor and two abstentions, capped a marathon session that began the day before and stretched into the early hours of Thursday.

Fireworks and shouts of joy erupted among anti-abortion activists camped outside Congress, while pro-choice campaigners, many decked in the green scarves that had come to symbolize their movement, were downcast.

Some burnt garbage and wooden pallets and threw stones at riot police, who attempted to disperse them with tear gas and water cannon.

The vote in Argentina followed a referendum in May in Ireland, another traditionally Catholic country, that paved the way to legislate for the termination of fetuses. It also came after months of heated campaigns on the polarizing issue.

The Argentine bill was passed by Congress's lower house in June by just 129 votes to 125, but was widely expected to fall short of the votes needed to pass in the Senate.

Lawmakers must now wait a year to resubmit the legislation.

"The debate will continue," said President Mauricio Macri, who praised "a mature parliamentary debate."

Although pronouncing himself "in favor of life," Macri had been largely responsible for pushing the bill to a vote in parliament.

He promised to increase sex education in schools and the distribution of contraceptives.

"The problem is there and we have to keep working hard so that all these girls will have the possibility to choose and plan their lives," he said.

- Not giving up -

Miguel Angel Pichetto, an opposition leader in the Senate, said pro-abortion campaigners would not be giving up.

"The future does not belong to the 'No' campaigners. Sooner rather than later, women will have the decision they need, sooner rather than later we will win this debate," he said in his closing speech.

His sentiments were shared by 21-year-old Camila Sforza, who said she remained hopeful despite the setback.

"This is just the beginning -- our movement will continue till we get the right to abortion," she said.

The no vote was also condemned by Amnesty International, which said Argentina had squandered a historic opportunity.

"The Argentine lawmakers chose today to turn their backs on hundreds of thousands of women and girls who have been fighting for their sexual and reproductive rights," said Mariela Belski, the group's executive director for Argentina.

She added that the Senate had "therefore decided to agree on a system which forces women, girls and others who can become pregnant to undergo clandestine and unsafe abortions."

But among anti-abortion activists, the mood was one of jubilation.

"We are happy because it is a celebration of democracy, the triumph of both lives," said Ayelen Caffarena, echoing the campaign's slogan, "let's save both lives", a reference to the mother as well as the unborn child.

Earlier in the day, scores of buses had brought people from around the country into Buenos Aires for dueling rallies outside Congress.

A partition was set up to keep the green-decked pro-abortion contingent separated from the anti-abortion activists who donned baby blue.

Currently, abortion is allowed in Argentina in only three cases, similar to most of Latin America: rape, a threat to the mother's life or if the fetus is disabled.

The bill had sought to legalize abortion during the first 14 weeks of pregnancy and would have seen Argentina join Uruguay and Cuba as the only countries in Latin America to fully decriminalize abortion.

It is also legal in Mexico City. Only in the Central American trio of El Salvador, Honduras and Nicaragua does it remain totally banned.

- Worldwide support -

The prospect of legalization had energized women's groups and still retains a huge support from citizens.

Rallies took place around the world in front of Argentine diplomatic missions, mainly in support of the bill.

Various charities estimate that 500,000 illegal, secret abortions are carried out every year in Argentina, resulting in around 100 deaths.

Opponents of abortion meanwhile held their own demonstrations.

Priests and nuns were joined by rabbis, imams and members of other Christian churches to oppose the bill.

Before Pena dismissed such a notion, Daniel Lipovetzky, a lawmaker from the ruling party, suggested that the matter might end up being put to a referendum.

"It's possible that we propose that," he said.

Ireland ended up overturning its own constitutional ban on abortion through a referendum held in May.