NZ First and the Greens both won concessions to the Bill, which amends the Misuse of Drugs Act 1975.

"New Zealand First promoted the inclusion of anyone in palliation rather than those who are defined as terminally ill, as was originally drafted," NZ First's spokesperson for Health Jenny Marcroft said.

"This was an important language change. We felt that the term palliation was more appropriate. Those requiring palliation are seriously ill, and the focus of treatment is on improving their quality of life."

She said the Bill takes a compassionate approach and will provide as many as 25,000 people with a much-needed defence.

The Greens pushed for a regulated local market to be established no later than a year from now, which will allow native strains of cannabis rather than just imported cannabis products.

Regulations, rules and quality standards will be based on the advice of experts.

Green Party drug law reform spokesperson Chloe Swarbrick said this concession will encourage a domestic market to develop rather than Kiwi users relying on imported products.

"This is a huge day for New Zealanders in pain and suffering who've been denied the only medicine that works for them," she said.

"Too many New Zealanders are going into debt to access expensive big pharma products, or being turned into criminals in having to access an unregulated black market for cannabis.

"Over the past year I've heard from hundreds of New Zealanders whose lives this will improve. I'm sure all of my Parliamentary colleagues engaged in this debate have heard the same stories. Today's law is compassion in action, with a strong footing in evidence-based policy."

During the Bill's final reading in Parliament, Ms Swarbrick read out an email she'd received from Taranaki woman Emma Helleur whose brother is terminally ill.

Health Minister Dr David Clark praised the work of the three parties in passing the legislation within a year of announcing it.

He said medicinal cannabis products will be made available on prescription.

"This will be particularly welcome as another option for people who live with chronic pain. Additionally the Bill removes cannabidiol as a controlled drug, so it becomes a prescription medicine."

He also praised NZ First's concession for those in palliative care, which he said is "about alleviating pain and suffering" for those with advanced life-limiting conditions.

"We know that some people cannot wait for medicinal products to become more readily available and will want to use illicit cannabis to ease their pain.

"People nearing the end of their lives should not have to worry about being arrested or imprisoned for trying to manage their pain."