New Zealand's Government has passed a law that will make medical marijuana widely available for thousands of patients over time.
The legislation will also allow terminally ill patients to begin smoking illegal pot immediately without facing the possibility of prosecution.
The measures come ahead of a planned national referendum on recreational marijuana use.
The Government has pledged to hold the referendum some time over the next two years, but has not yet set a date or finalised the wording.
The new law allows patients much broader access to medical marijuana, which was previously highly restricted.
But most patients will have to wait a year until a new set of regulations, licensing rules and quality standards are put in place.
The law will also allow medical marijuana products to be manufactured in New Zealand for both domestic and overseas markets.
Health Minister David Clark said in a statement the new law would help ease suffering.
"This will be particularly welcome as another option for people who live with chronic pain," he said.
He said the 25,000 people who are in palliative care with terminal illnesses did not have time to wait for the new scheme, and so the law provided a legal defence for them to use illegal marijuana.
"People nearing the end of their lives should not have to worry about being arrested or imprisoned for trying to manage their pain," Dr Clark said.
But the Opposition's health spokesman, Shane Reti, said the new law was "lazy and dangerous" because it does not provide details of the planned medical marijuana scheme, and would also allow some people to start smoking pot in public.
"We support medicinal cannabis but strongly oppose the smoking of loose-leaf cannabis in public," Dr Reti said.
"Smoked loose-leaf is not a medicine."
Dr Reti said the new law amounted to decriminalising marijuana by stealth.
& Keep Up to Date
Get the latest pot stock recommendations, cannabis news
and industry updates straight to your inbox!