The End of Life Choice Bill has passed its second reading.
After a day of robust Parliamentary debate, David Seymour's euthanasia Bill - with minor amendments - was put to a vote on Wednesday evening.
There were 70 votes for the Bill, and 50 against.
The vote was originally declared by Speaker Trevor Mallard to be 70-51, it was later corrected to 70-50.
- End of Life Choice Bill on brink of moving toward law
- 'Just do it': Terminal patient pleads politicians to pass euthanasia Bill
- Legalising assisted dying sends wrong message to vulnerable people - anti-euthanasia advocate
The Bill would allow people over 18 to request a fatal dose of medication if they have less than six months to live or are suffering from a "grievous and irremediable medical condition".
MPs voted according to their conscience rather than along party lines.
Parliament was divided with emotional speeches from politicians on both sides of the issue, many of whom had watched their parents die slowly and painfully.
National MP Judith Collins teared up while describing her father's "terrible pain" before he died of bone cancer 25 years ago. She said she used to oppose assisted dying but now believes giving people the choice to die with dignity is the right thing to do.
"I am on the right side now - everybody deserves some dignity in their lives. I would do it again, it's the right thing to do, and it preserved his dignity."
Amy Adams also gave a moving speech about her mother who died from melanoma.
"All of us are affected by our own experiences in this issue - for me, it was watching my mother die a gruesome, painful and dehumanising death," she said.
"And it wasn't because of lack of palliative care, and it wasn't because there wasn't every opportunity and drug available... what she wanted was to be able to choose exactly when that end would come in her last few days."
Justice Minister Andrew Little said the last years of his father's life were "a misery".
"This bill is about those people whose health condition is such that they have no future," he told Parliament.
"The question is whether we should allow the law, as it is at the moment, to stand in their way, to make a decision of their choice about how they wish to meet their inevitable end."
Maggie Barry, who has strongly opposed assisted dying, called the Bill the most poorly drafted she'd ever seen.
"When Parliament threw out the death penalty some 60 years ago, one of the most persuasive arguments against it was the fear that an innocent life might be taken. That same level of seriousness needs to be at the heart of our decision tonight."
The Bill will now move to the House where more major amendments will be proposed and debated, before it faces its third and final reading.