New Zealand has passed a landmark bill to decriminalise abortion after decades of campaigning.

Andrew Little, the justice minister, said it was long overdue that the procedure would become classified as a health matter and not a criminal one.

The issue was scheduled to be put to a public referendum, but the government scrapped that option late on Wednesday.

“For over 40 years, abortion has been the only medical procedure considered a crime in New Zealand. But from now abortions will be rightly treated as a health issue,” Little said in a statement.

“The previous law required a women seeking an abortion to go through many hoops. That resulted in delays to access a procedure, and that was less safe. The changes agreed to by parliament will better ensure women get advice and treatment in a more timely way.”

Key elements of the bill that passed through parliament included removing abortion from the Crimes Act, allowing women to choose abortion up to 20 weeks after consultation with a GP, and promoting counselling options for women choosing an abortion.

Terry Bellamak, the director of Alranz Abortion Rights Aotearoa, celebrated the move, saying it heralded a progressive step forward for New Zealand.

“Finally the New Zealand parliament has brought abortion legislation into the 21st century – it only took 44 years,” Bellamak said. “Finally after 44 years, New Zealand parliament has recognised that women have bodily autonomy – and that is huge. Being able to control one’s fertility is key to one’s life – it is hard to see how we could achieve equality without that.”

Previously under New Zealand law, abortion was allowed only in cases of incest, “mental subnormality” or foetal abnormality, or where the physical or mental health of the mother was at serious risk. Other factors that were taken into consideration but were not grounds in themselves included “sexual violation” and “extremes of age”.

Jail terms of up to 14 years for those who procured a termination were possible under the Crimes Act, but the law was never enforced and women who underwent abortions were not liable for prosecution. But Little said the change was nevertheless needed.