(CNN) -- Irish lawmakers overwhelmingly passed new legislation early Friday that allows abortions if the mother's life is at risk.
Members of Parliament in the devoutly Catholic country spent hours before its passage debating the Protection of Life During Pregnancy Bill 2013. The vote was 127-31 in favor of the bill.
Conservative and progressive lawmakers argued over amendments to the draft law.
Religious lawmakers and church leaders are upset over a provision allowing abortion if a pregnant woman is acutely at risk of committing suicide. They called it a "Trojan horse" leading to easy abortion access and wanted it removed, but the provision was included in the final bill, according to The Irish Times.
A woman can't just threaten to commit suicide and expect to receive an abortion, according to the bill. Two psychiatrists and an obstetrician must certify that the risk of suicide is "real and substantial."
Female lawmakers introduced an amendment to permit abortions if a woman becomes pregnant after incest or rape, but later shelved it when it ran into resistance, the Times reported.
In its final provisions, the bill underlines existing Irish laws to protect the fetus.
"It shall be an offense to intentionally destroy unborn human life," it reads. A woman who violates the law could face a maximum penalty of 14 years in prison.
The bill has proved divisive even within the government. European Affairs Minister Lucinda Creighton, who was opposed to elements of the legislation, resigned Thursday, Prime Minister Enda Kenny confirmed.
Doctors and hospital personnel involved in illegal abortions face the same punishment, according to the bill.
The issue was brought to the forefront last year when a 31-year-old woman died after doctors refused to perform a life-saving abortion.
Savita Halappanavar went into a hospital in Galway, Ireland, in October, complaining of severe back pain.
Doctors established Halappanavar, who was 17 weeks pregnant, was having a miscarriage. But they did not terminate the pregnancy, afraid the law would not allow it.
Three days after the request for a termination was made, the fetus died and was removed. Four days later, Savita died of a blood infection.
Public outrage over her death likely hastened the passage of the new legislation.
It was proposed after a 2010 ruling by the European Court of Human Rights, but had been moving slowly through the legislative system.
The European Court of Human Rights found that Ireland's failure to regulate access to abortion had led to a violation of its human rights obligations.
Twenty years ago, the Irish Supreme Court ruled abortions are allowed when there is a real and substantial risk to the life of the mother.
But the ruling was never enacted into law, meaning there was little clarity for doctors or patients as to when an abortion could not take place.
Human Rights Watch said the new legislation failed Ireland's women by not going far enough to reform the country's abortion laws.
It did "the bare minimum" to comply with the European court ruling, and did not address other issues such as the rights of women who are pregnant as a result of rape, it said in a statement.
"The new law does add clarity, but requiring women to seek multiple approvals from health professionals may delay or defeat access to legal abortions," said Gauri van Gulik, women's rights advocate for Human Rights Watch.
"Ultimately it does little to improve the draconian restrictions on abortions."
CNN's Peter Taggart in Ireland contributed to this report.