Lawmakers voted on Wednesday to liberalize New Zealand’s abortion law and allow unrestricted access during the first half of pregnancy, ending the country’s status as one of the few wealthy nations to limit the grounds for abortion during that period.

Members of Parliament also greatly loosened restrictions on abortions in the latter half of pregnancy, with language that opponents say amounts to no meaningful limitations until the moment of birth.

Lawmakers voted 68 to 51 to approve the bill, which would take effect a day after receiving assent from the governor-general, Queen Elizabeth II’s representative in New Zealand, which is considered a formality.

New Zealand’s existing law on abortion, adopted in 1977 and amended a few times, treats termination, even early in pregnancy, as a crime, though officials say that no one has ever been prosecuted for it. The new law would remove it from the criminal statutes, and provides no penalties for violation.