The Misuse of Drugs Amendment Bill has passed its final reading in Parliament.
The bill gives police discretion to take a health-centred approach, rather than prosecuting those in possession of class A drugs.
It also classifies the synthetic cannabinoids AMB-FUBINACA and 5F-ADB as Class A drugs and enables temporary drug class orders to be issued for emerging substances.
The bill passed 63 votes to 57, with Labour, the Greens and NZ first voting in favour and National, ACT and Jami-Lee Ross voting against the bill.
After negotiations with New Zealand First, the Health Minister David Clark agreed to clarify the wording before the bill's third reading, so police can only take a health-centred approach when it is in the public interest.
Dr Clark said police were already exercising discretion, but the bill supports their practice.
"Generally I would expect in the public interest it would be more sensible to apply a therapeutic approach.
"But where somebody for example is more clearly not willing to go down a therapeutic road and there are other people in danger, I expect the police will continue to do what they do now, which is follow a path to prosecution," he said.
Dr Clark said it will mean resources are freed up so police can go after manufacturers and suppliers of drugs, rather than those caught in the web of addiction.
But during the reading's debate, National police spokesperson Brett Hudson said it would tie the hands of police and Crown prosecutors.
Mr Hudson said if for example someone caught multiple time with possession of meth and the police deemed it in the public interest to prosecute, as soon the case went to court it would be challenged.
"They can argue in the court it has to be proven a health-based approach would not have been better in the public interest in that case and that did not and has not existed in the discretionary powers officers have exercised before," he said.
National MP Paula Bennett said the bill decriminalized drugs by stealth.
"National supports both greater rehabilitation and tougher sentences, treatment and deterrence should go hand in hand.
"However this Bill means Police won't prosecute people who are buying and using hard drugs including P, heroin and cocaine," she said.
Ms Bennett added police aren't social workers and the bill meant it will be up to them to help people try to find services that don't exist.
But NZ Drug Foundation executive director Ross Bell welcomed the passing of the bill.
"Convicting people for using drugs has done nothing to reduce use.
"Going after people, especially very vulnerable members of our community, is not only a waste of Police time, it gets in the way of people putting up their hand for help", he said.
He said the law change was prompted by a shocking number of deaths caused by dangerous synthetic drugs, for which he added New Zealand was woefully unprepared.