New Zealand has voted to legalise euthanasia in what campaigners call "a victory for compassion and kindness".
Preliminary referendum results showed 65.2% of voters supported the End of Life Choice Act 2019 coming into force as a new law.
It will allow terminally ill people, with less than six months to live, the opportunity to choose assisted dying if approved by two doctors.
For its opponents the law lacks adequate safeguards.
The results announced on Friday do not include an estimated 480,000 special votes, including overseas ballots, so the final outcome will not be confirmed until 6 November. But with such strong support, the decision is not expected to change.
The referendum is binding and the new law is expected to come into effect in November 2021.
It will see New Zealand join a small group of countries, including the Netherlands and Canada, which allow euthanasia.
The referendum on assisted dying was held alongside the general election earlier this month. In a separate non-binding referendum held at the same time, New Zealanders narrowly rejected a proposal to legalise recreational cannabis.
The preliminary results on the cannabis vote was 53.1% no and 46.1% yes - though this result may be subject to change when the special votes are counted.
What has the reaction been?
The "yes" verdict had been anticipated after polls suggested strong public support for the law, which was also backed by Prime Minister Jacinda Ardern and the opposition leader, Judith Collins.
But it was the result of an emotional, years-long campaign with strong views on both sides of the debate.
For Matt Vickers, who took on his late wife Lecretia Seales' fight to legalise assisted dying, the result is "a victory for compassion and kindness".
"I am grateful that terminally ill New Zealanders will have a say about the ends of their lives," he told the BBC after the announcement.
Ms Seales was a lawyer who launched a legal challenge for the right to end her life with medical assistance after she was diagnosed with a brain tumour. But her case was unsuccessful and she died of her illness five years ago, aged 42.
Mr Vickers pressed on with her campaign and in 2016 his book, "Lecretia's Choice: A Story of Love, Death and the Law", was published.
The day before the result Mr Vickers told the BBC that ultimately his late wife's goal was for terminally ill people "to have a choice".
"She didn't want to die. No one does. That's a popular misconception. The problem was the choice to live had been taken away," he said. "She wanted a choice on how death happens so if things got bad she could end the suffering at the time she wanted."
What is the new law?
The End of Life Choice Act was passed by parliament in 2019 after years of heated parliamentary debate and a record number of public submissions.
But there was a proviso that it would first be put to a referendum, only coming into force if more than 50% of voters ticked "yes".
There are a number of criteria a person must meet to ask for assisted dying. These include:
suffering from a terminal illness that's likely to end their life within six months showing a significant decline in physical capability being able to make an informed decision about assisted dyingThe legislation authorises a doctor or nurse to administer or prescribe a lethal dose of medication to be taken under their supervision if all the conditions are met.
The law also says a person cannot be eligible for assisted dying on the basis of advanced age, mental illness, or disability alone.
Which countries allow euthanasia?
The referendum result in New Zealand will be closely watched by advocates for and against assisted dying throughout the world.
By voting "yes" the country is joining a small group of nations and territories that have passed similar legislation.
Euthanasia is legal in Belgium, Canada, Colombia, Luxembourg and the Netherlands, while assisted suicide is permitted in Switzerland.
A number of states in the United States and the Australian state of Victoria have also made assisted dying legal.
Euthanasia is the act of deliberately ending a person's life to relieve suffering, while assisted suicide is the act of deliberately assisting another person to kill themselves. In contrast to euthanasia and assisted suicide, assisted dying would apply to terminally ill people only.
Source: BBC