Last night's vote was originally declared by Speaker Trevor Mallard to be 70 votes to 51 - even though there are only 120 MPs.
He returned to the House a short time later to apologise and to explain that one MP's name was so long, Anahila Kanongata'a Suisuiki, that it ran over two lines and was crossed off twice, which meant it was counted twice.
Act Leader David Seymour's The End of Life Choice Bill passed after a debate in which many MPs shared emotional stories of personal loss.
The bill legalises voluntary euthanasia by allowing adults with less than six months to live or those with a "grievous and irremediable medical condition" to request a lethal dose of medication.
The vote now means debate over the bill will continue when it returns to the House in about a month, for a debate where hundreds of amendments will be proposed.
Several MPs changed their votes from the first reading including National's Judith Collins and Labour's Deborah Russell.
Seymour has agreed to support an amendment which would restrict euthanasia to only the terminally ill.
JUDITH COLLINS - NATIONAL
A teary-eyed Judith Collins has described holding her father's hand while he died, as she gave her backing to the controversial assisted dying bill.
Collins, who voted against the bill at its first reading, told the House she had previously opposed euthanasia because her father had been able to die in dignity because of access to morphine and the support of family.
"He died without losing his dignity ... I thought that was available to everybody. It's not available to everybody," she said.
Collins said, as a former lawyer, she had always been concerned assisted dying could lead to coercion of the vulnerable, but that Seymour had assured her with his plans for amendments for the bill.
"This year I have been very troubled by it, because I felt that, having been opposed to it, I was on the wrong side," she said tearing up.
"I am on the right side now."
GERRY BROWNLEE - NATIONAL
National MP Gerry Brownlee told Parliament the elderly and vulnerable would be put under pressure if the bill passed, saying it would have "coercive power".
"It would be unfortunate if we were to see peoples starting to think: 'well I've had a good innings. So now maybe I should opt to make the choice that makes it easy for so many others'," he said.
Brownlee described having to tell his mother she would die within a month if she didn't get treatment for her brain cancer or that she could live a year-and-a-half if she fought it.
"She just sat up and said 'What a month? … Bugger that, I'll have the treatment.'. And it wasn't easy. It was awful. But she did as much from her desire for us to have a farewell," he said.
"I don't think we should have a bill, passed into an act, that makes that choice to end a life so much easier than it is at the moment."
GREG O'CONNOR - LABOUR
Labour's Greg O'Connor spoke of his intellectually disabled son's struggle for survival in early life as he put his support behind the bill and called on other undecided MPs to do the same.
O'Connor, who was on the Select Committee that considered thousands of submissions into the bill, said the House owed it to the public to pass the legalisation on Wednesday and keep debating it.
"It's quite something to be standing with your wife and the paediatrician tells you to your face and looks you in the eye and says: 'you know there won't be a post-mortem if this boy dies'," he recalled.
He said his son had been put on a respirator, and was taken off unsuccessfully twice, before a third attempt.
"He did make it," O'Connor said.
"That's given me the opportunity to perhaps see and get close to death, either side of it, that many don't get the opportunity to do.
"And I think that, alongside my experience at the Select Committee, considering those who came to see us, hearing how it's administered overseas, has given me the opportunity, I think, to use my life's experience to make the right decision. "
WILLIE JACKSON- LABOUR
Labour Māori caucus co-chair Willie Jackon said he would be supporting the bill despite being brought up in the traditional Maori way and lobbying from within Maoridom.
"Whanau decide everything. We had no choice when came into this world and we have no choice when we go out," he said.
"The collective is everything … and tikanga is everything."
But Jackson said his mother, Dame June Jackson's, current health had changed his mind.
"My mother was a speaker for our people, a leader for our people," he said.
"But Mum is not that person anymore. I know that she would have never believed in euthanasia, but I think Mum, if she saw herself today, she may well change her view."
The Maori caucus was "split right down the middle" on the issue Jackson said.
NICK SMITH - NATIONAL
Nelson MP sat on the select committee that heard submissions on the bill.
He said the bill was "out of step with a core part of our Kiwi culture – that respect for human life."
"In many parts of the world, life's cheap. But here we go to extraordinary lengths to protect human life.
"It is not that New Zealanders are puritanical or deeply religious. It's actually a very down-to-earth practical caring."
He said the "cold, calculating clauses" in the bill that allowed the termination of life of someone who was unwell or disabled contradicted those basic Kiwi values.
The most powerful submissions were from people who worked in palliative care who cared for dying people.
Euthanasia was one of those ideas that superficially sounded quite attractive "but the more you look into the detail, the more skeptical you become."
NIKKI KAYE - NATIONAL
Auckland Central MP Nikki Kaye said it was one of the most difficult pieces of legislation to come before Parliament.
But the fundamental reason she supported the bill was because of compassion.
"The overwhelming evidence shows that there are a group of people who suffer.
"The overwhelming evidence shows there are also a group of people who commit suicide in a very violent way because they do not believe in the current law and the process that is in front of them."
She paid tribute to the late Lecretia Seales who took an unsuccessful case to the High Court to seek protection for her doctor to help her end her life when she was suffering from brain cancer.
She said the bill if it was passed would affect a very small group of people.
"We say we are one of the most progressive nations in the world. But other jurisdictions have moved and we have failed. "
DAVID CLARK - LABOUR
Health Minister and Dunedin North MP David Clark who opposes the bill spoke about how his grandmother had attempted suicide many times during his childhood "because she felt a burden on society as someone who struggled at times with a mental illness."
"My most fundamental concern with this legislation is that sanctioning euthanasia makes it easier for vulnerable people to feel that the most appropriate option is to take their own life and that it is very difficult to ensure protections sufficient to preclude this ever happening."
But he said whether the bill was passed or not, MPs carried a responsibility.
"If it goes down, those who vote it down have a responsibility for making sure we have improved palliative care.
"Those who vote it up, if it goes up, have a responsibility to ensure they do everything in their power to protect our most vulnerable.
"I do oppose the bill but I do not think the world will end if it passes either."
MAGGIE BARRY- NATIONAL
Maggie Barry, who has been a staunch campaigner against the bill, said Parliament was making its biggest life-or-death decision since it abolished capital punishment.
"How many unintended deaths is too many?" she asked
"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."
She described the bill as the most poorly drafted she had ever seen.
"There are no genuine protections against coercion and abuse," she said.
"Once the genie is out of the bottle, there is no going back."
AMY ADAMS - NATIONAL
Earlier National MP Amy Adams described watching her mother die a "painful and dehumanising" death as she too threw her support behind the bill.
She told the House while she felt the legislation needed more work before it could become law, it contained "kernels" of what could be a system to give people a choice about how to die.
She said the decision would be personal for many.
"For me it was watching my mother die a gruesome, painful and dehumanising death," she said.
"If she had wanted to spend her last days drugged to the eyeballs feeling nothing I am sure that was possible. But that isn't what she wanted. What she wanted was to be able to choose exactly when that end would come. That's really all we were talking about.
"This was a woman who was proud, independent, intelligent, knew what she wanted. … Instead we watched her get literally eaten alive from a vicious melanoma and suffer."
Adams said her core concern was about the bill extending to those with "irremediable conditions".
Adams said her core concern was about the bill extending to those with "irremediable conditions".
Act leader Seymour has promised that if the bill passes its second reading, he'll amend it to only apply to the terminally ill.
That follows widespread concern the "irremediable condition" clause would put vulnerable people at risk of coercion.
ANDREW LITTLE – LABOUR
Justice Minister Andrew Little described how his father, a former British Army officer, had fought to the last breath, but died on his own terms.
"He had a terminal illness and the last years of his life were frankly a misery. For him and for my mother. And for me and my siblings," he said.
"As I saw him in his dying hours, on his bed, in the hospice, struggling to take those last breathes, clearly in pain, he was not going to give up … Nothing was going to stop him seeing himself through to the end of his days."
The debate was not about suicide, Little said.
"This bill is about those people whose health condition is such that they have no future," he said
"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."
DAN BIDOIS - NATIONAL
Northcote MP Dan Bidois who came into Parliament in a byelection after the bill had its first reading said that he had previously said he supported the bill.
But he said it was with a heavy heart that he now opposed it. He held a public meeting and he read letters from thousands of people who had emailed him.
He was concerned at the lack of safeguards in the bill and he especially worrIed about the impact of the bill on the elderly.
"I've had several cases in the last year as an electorate of elderly people coming into my office and saying 'Dan, I need your help. I need your help because my son or daughter has complete control of my financial affairs and I am worried about my safety.'
"I have very grave concerns about how this bill protects our most vulnerable elderly from coercion."
He said it was very difficult to detect coercion.
CHRIS BISHOP - NATIONAL
National's Chris Bishop told the House while there was a place for palliative care, there would always be those who it could not help.
"Medically assisted dying happens already," he said.
"This happens now. It's just unregulated."
He said while he understood concerns about coercion, he believed the bill had enough safeguards.
DAVID SEYMOUR - ACT
Speaking first, Seymour urged Parliament to back the bill, saying denying the suffering a right to choose when to die would be "barbaric".
"In a modern, civilised society such as New Zealand, we should be legislating choice and compassion," he said.
"In one of the most private times in a citizen's life, we should not interfere, but give them the choice to go on their terms, in their time."
The Member for Epsom, who first put the bill in the ballot in 2015, described the lengthy process legislation had been through as "rigorous and comprehensive".
"By sheer numbers, consultation has been greater than any other in the history of our parliament," he said.
Seymour also tried to assure those concerned the bill could lead to coercion.
"If coercion is suspected at any point in the process, the person becomes ineligible for assisted dying," he said.
He also said suggestions doctors would have to do things against their beliefs were "plainly untrue".
"There are now 200 million people living in 15 jurisdictions where Assisted Dying is legal. Not one of them, that have experienced the reality of an assisted dying law rather than the opponents' rhetoric, has gone back," he said.
"To vote no to this bill is to say 'tough luck, you must suffer for the morality of others.' I believe that is a barbaric conclusion."
Under the bill, the person seeking assisted dying would have to get clearance from two medical practitioners and if either of them had doubts about the person's competence, a third opinion would need to be sought from a psychiatrist or psychologist.
This is the fourth attempt since 1995 to get a euthanasia law through Parliament. It passed its first reading 76 votes to 44 – meaning 17 MPs need to change their minds to block it.
It received a record 39,159 submissions during a fraught and year-long Select Committee stage that included hearings in 14 cities.
Politicians were on Wednesday still announcing last-minute shifts, Collins saying she had swapped to "yes" to allow the bill to be debated further, while Labour's Kiri Allan said she would change to a "no" because she wasn't happy with what had come out of the select committee process.
If the bill does make it through the second vote, it'll face a number of hurdles, including from opponents who are pledging to table more than a hundred amendments during the committee stages.