The public will decide whether euthanasia will be legalised after MPs voted in favour of a referendum at the 2020 election - provided the bill passes its final hurdle in Parliament.
The vote was 63 for and 57 against.
The End of Choice Life Bill will move to its third reading in November – if passed by MPs, the question of legalising euthanasia will then go to the public next year.
A referendum was a bottom line for New Zealand First MPs, who voted in favour of the second reading but threatened to pull any further support if one was not held.
The party submitted the proposed change to the End of Choice Life Bill for a binding referendum at the 2020 election. A referendum on legalising cannabis will also be held at the election.
NZ First health spokesperson Jenny Marcroft told the House that euthanasia "directly affects the fabric of society, therefore we believe temporarily empowered politicians of which we all are… we alone should not decide but we should have the courage to allow the voting public to participate in this".
“This is an emotive topic, it is a divisive topic.”
If the public vote "yes" to legalise euthanasia, the End of Life Choice law would come into force 12 months after the official results are released.
If it is voted down by the public, the bill will be repealed.
It has been a long process of MPs working through proposed changes, occasionally staying until 1am to comb through the finer details of the bill.
In that time the scope of the bill was narrowed to allow people with a terminal illness with less than six months to live.
Earlier this year, David Seymour said some supporters may be disappointed his amendments would create "one of the most conservative assisted dying regimes in the world, but I have listened to concerns from supporters and opponents”.
The proposed law passed its first two readings, the first time in 2017 by 76-44, and the second 70-50 in June this year.
In July, a 1 NEWS Colmar Brunton Poll found 72 per cent of people were in favour of legalising euthanasia for those with a terminal illness or were incurably ill. Twenty per cent were against.
The 2018 1 NEWS Colmar Brunton Poll found 76 per cent agreed with making euthanasia available, with 15 per cent against.
The 2017 poll had 74 per cent "yes" and 18 per cent "no", and the 2015 poll had 75 per cent 'yes" and 21 per cent "no". Another poll in 2003 found 73 per cent were in favour passing a euthanasia bill into law.