Buenos Aires, Argentina (CNN)The Argentine Chamber of Deputies voted Thursday morning to legalize elective abortion in the first 14 weeks of pregnancy.
Argentina's lower house of Congress approves bill liberalizing abortion laws
The bill now goes to the more conservative Senate for consideration. President Mauricio Macri has said he won't veto the bill if Congress approves it, even though he opposes abortion.
"We have been able to settle our differences with respect, tolerance and listening to each other; understanding that dialogue is the road that will strengthen our future," Macri said. "My congratulations to everyone, knowing that this debate now continues in the Senate."
Though it's unclear whether the bill will become law, the issue has energized Argentine women, including thousands who filled the streets around Congress during 23 hours of tense debate.
"Legal abortion in the hospital!" they chanted upon hearing the bill was approved.
In Argentina -- a Catholic country and the homeland of Pope Francis -- abortion is illegal except in cases of rape or when the woman's life is endangered. Supporters of abortion reform say even those legal abortions are difficult to obtain. Women who otherwise get abortions can be imprisoned for as long as four years.
The Chamber of Deputies' bill also would allow women to get legal abortions after 14 weeks if the pregnancy resulted from rape, the woman's health was at risk, or the fetus suffered severe conditions not compatible with life outside of the womb.
The vote was 129 to 125. It first was reported to have passed with 131 votes, but two congressmen claimed they pushed the wrong button and voted for the bill when they meant to vote against it.
As soon as the vote was announced, thousands of pro-choice activists who had gathered to watch the vote on a giant screen outside Congress broke into cheers.
"I cried and hugged my brother," Ariadna Mina, a 15-year-old Catholic school student, said. "I really feared it was going to be rejected. I was anxious all night."
Hours earlier it seemed the bill was destined for failure, but shortly before the vote there was a last-minute shift and the measure passed by four votes.
"It was a huge surprise that it was approved, although we were optimistic I personally couldn't believe it," said Florencia Llamas, 28, a drama teacher. "Lately in this country it seems rights are always being cut, and here we have something that marks a change of era for women's rights."
While pro-choice activists continued celebrating hours after the vote, the area reserved for anti-abortion demonstrators was empty except for a few stragglers, including Liliana Fernández, a 39-year-old accountant who had tears in her eyes.
"I can't believe it, I really can't believe it," she said. "I thought our representatives would never vote in favor of death. ... Now we have to make sure senators don't follow their lead."
Almendra Pizarro, 26, a lawyer, said her joy at the decision was short-lived.
"I was ecstatic for a second but we have to be realistic," she said. "It will be tough fight in the Senate." Despite that concern, "I feel this is a great conquest, the result of a fight that has been going on for a long time."
Supporters of the Argentine bill were heartened by a recent vote in Ireland, another predominantly Catholic country. Irish voters in May approved an amendment to the country's constitution that would allow the repeal its near-total ban on abortion.
"With the vote in Congress, Argentina can join the global trend toward expanding legal grounds to allow abortion and affirming the rights and dignity of women and girls," José Miguel Vivanco, Americas director at Human Rights Watch, said before Thursday's vote.