Late Wednesday, Chilean lawmakers approved legislation that would allow for abortions under certain circumstances, ending the country’s longstanding wholesale ban on the practice.

The new law would permit abortion in the cases of rape, endangerment of a mother’s life, or in cases when the fetus has a life-threatening birth defect. It would allow for objecting doctors to refuse to perform abortions, except in cases when the mother’s life is in danger and there are no other available physicians.

The legislation has drawn harsh criticism after a year's-long heated debate from many in the majority-Catholic country, including many of the country’s bishops who have expressed their dismay at the lifting of the ban.

Bishop Fernando Chomali of Concepción told CNA he “deeply regretted” that the law had thus far been approved, noting that it wouldn’t help women in need and that it goes against the country’s constitution.

"I deeply regret that the bill has been approved. It seems to me that it does not help women in difficult situations and opens the door to free abortion, as it has happened in many parts of the world," he said.

The new law will go into effect if Chile’s Constitutional Tribunal approves it in the coming days, which would end a blanket ban on the procedure that has been in place in the country for nearly 30 years.

However, it also needs to survive an appeal to the Constitutional Court which seeks to declare the abortion bill unconstitutional. The appeal was filed by 11 senators from Chile Vamos, a coalition opposed to the government of President Michelle Bachelet.

While abortion was allowed for in some circumstances in Chile starting in 1931, it was strictly outlawed in all circumstances by dictator Augusto Pinochet’s regime in 1989, and punishable by up to five years in prison.

Bachelet has made relaxing abortion restrictions a priority of her administration, and celebrated the approval of the legislation on Twitter.

Bishop Chomali called on the Constitutional Court "to act with knowledge and conscience in the light of the Constitution of the country that protects the life of the unborn. I have great hope that those who compose it will think about the common good and the weakest," he told CNA.

Bishop Juan Ignacio González of San Bernardo said the law violates the truth of the human person, according to local newspaper El Mercurio.

"Democracy can not give up an essential core of ethical truth, which allows it to affirm the full validity of the rights of all members of the human race,” unless it embraces a “false pluralism or tolerance,” he said.

Giselle Vargas contributed to this report.