CHRISTCHURCH, New Zealand — New Zealanders voted in a referendum to allow voluntary euthanasia for the terminally ill but were marginally opposed to legalizing marijuana, initial results showed Friday, putting the nation on course to become one of the few to permit assisted dying.

With nearly all votes tallied, 65 percent voted in favor of euthanasia, a proposition that has only made the statute books in a handful of countries, including the Netherlands and Canada, and some U.S. states. The cannabis result was much closer, with 53 percent opposed and 46 percent in favor.

The outcome will likely burnish the liberal-reformist credentials of Prime Minister Jacinda Ardern, who revealed Friday that she had voted yes to both questions. The referendum was held alongside national elections Oct. 17, when Ardern won a second term in a landslide after containing the coronavirus in New Zealand, though until now she had declined to say which way she voted on the referendum issues.

The results were not unexpected. Unlike the close contest over cannabis, polling over recent weeks consistently pointed to wide public support for the End of Life Choice Bill, which has already been approved by parliament. With most of the votes returned, it appears that voters’ verdict on euthanasia, which is binding, will become law by late 2021.

A spokesperson for Ardern said Friday that her center-left Labour government is committed to implementing voters’ decision when final results are known next week — after overseas, prisoner and mail-in responses are counted.

Supporters of assisted dying celebrated the outcome. David Barber, spokesman for the End-of-Life Choice Society of New Zealand, said the yes vote would be a “big boost to others around the world seeking an enlightened and compassionate law change.”

Hospice New Zealand, a nonprofit for professionals caring for the terminally ill, acknowledged the victory for voluntary euthanasia but reiterated concerns about how it would work in practice.

“Our concerns around a lack of safeguards and pressure on vulnerable people are even more apparent now the act will come into force,” it said, adding that the organization was “particularly thinking about those who may be vulnerable to the presence of euthanasia through a lack of other options.”

The verdict on cannabis, meanwhile, which is nonbinding, puts New Zealand at odds with a liberalizing trend elsewhere in the developed world, including the United States, where legal marijuana has become big business.

Asher Etherington, a campaigner for drug-reform group Make It Legal New Zealand, expressed disappointment at the outcome.

“If no voters thought that by voting down this opportunity, Kiwis would cease to consume cannabis, they have not been paying attention,” he said. “The cannabis reform lobby here has fought for decades and is prepared to fight for decades more to achieve positive reform.”

The government had previously released a draft bill to legalize cannabis; however, it is unlikely that it would risk alienating many voters by defying the referendum result. On Friday, Justice Minister Andrew Little, a senior Labour lawmaker, said it was “highly unlikely” that the preliminary referendum results would be overturned in the final count, adding that the government has “no other plans in terms of drug law reform.”

Mike Kara, 18, a recreational marijuana smoker from Christchurch who voted yes in the referendum, said he would be “extremely happy” if cannabis were eventually legalized. In his view, use of the drug “doesn’t really harm anyone else” and legalization would free up law enforcement resources.

“So much taxpayers’ money is wasted on stupid stuff like jailing weed smokers,” he said.

The result will have disappointed campaigners in the United States, where New Jersey is set to vote Tuesday on legalizing the possession and use of cannabis for adults over 21 years old.

Speaking before the release of New Zealand’s results, Axel Owen, campaign manager for NJ CAN 2020, an advocacy group that favors legalization, said that a victory in New Zealand would show that voters in both domains “recognize the importance of turning the page on the prohibition of adult-use cannabis.”

Legalizing the drug, he said, “grows economic and workforce development opportunities, strengthens public health and safety, and offers a unique opportunity to advance social equity and justice.”

But New Zealand’s center-right National Party, which opposed legalization, hailed the result as a “victory for common sense.” In a statement, it said the country would be “healthier, safer and more successful” by maintaining the ban on the substance.