New Zealand will become one of the world's only countries to offer paid bereavement leave for workers who suffer a miscarriage, after lawmakers unanimously approved the motion on Wednesday.

Employees in the country will be entitled to three days' leave after a miscarriage under the law, which is set to gain royal assent after passing its final stage in parliament.

Ginny Andersen, the Labour MP who introduced the bill, said it would make New Zealand only the second country to provide such a benefit to her knowledge. India allows women six weeks of leave after a miscarriage.

"I can only hope that while we may be one of the first, we will not be one of the last, and that other countries will also begin to legislate for a compassionate and fair leave system that recognizes the pain and the grief that comes from miscarriage and stillbirth," she said in parliament during the final reading of the bill.

New Zealand -- the first self-governing country to allow women to vote, in 1893 -- has passed a number of laws in recent years that have been hailed by women's rights groups, including moves to reduce the impact of period poverty.

The latest move comes more than a year after the country decriminalized abortion, reversing a stance that had made it an outlier among most of the developed world.

During the bill's reading on Wednesday evening, Andersen acknowledged that many employers already provide leave for employees who have suffered a miscarriage. But she said "there are some who are making employees use up their sick leave at a time when they are dealing with extreme loss, and that is callous and that is wrong."

And she suggested that the new law would help remove stigma that surrounds miscarriage. "I hope that this bill will go some way in allowing women to feel more comfortable about talking about miscarriage and that they feel comfortable reaching out for support and for help in what is a huge physical and emotional loss," Andersen told lawmakers.

The bill passed without any dissent, and lawmakers who spoke in its final debate unanimously praised the contents of the legislation.

"Occasionally and not often enough, in my view, we come together as parliamentarians in a unified, dignified, respectful way to do the right thing," Scott Simpson, a member of the opposition, center-right National Party, said during the debate. "This is an example of such an occasion."

Jacinda Ardern's Labour Party commands a comfortable majority in New Zealand's parliament, and the leader has long made the advancement of women's rights one of her flagship policy objectives.