Parliament passed legislation under urgency that effectively bans all synthetic cannabis and party pills, because they can't be tested on animals.
The legislation passed just before 10pm on Tuesday and will come into effect from midnight Wednesday. It will then be an offence to sell, supply or possess synthetic drugs.
The vote for the Psychoactive Substances Bill was 107 in support, with 14 abstentions from the Greens.
It effectively bans the 36 legal high products still being sold.
Health Minister Tony Ryall told the House: "So let's be clear here. Parliament passes the legislation; the Governor General signs the legislation and then at 12.01am on Thursday it becomes illegal to sell, supply or possess illegal highs."
National's Paul Hutchison told Parliament it was a complex issue. "And countries around the world are wrestling with the best and effective way to minimise harm from psychoactive substances."
Psychoactive products will be allowed back on shelves only after being tested, without using animals, and proven low risk.
The Government has said, however, if evidence resulting from overseas animal tests helps prove a product is not safe, it can be used under the testing regime, to block a product from being sold.
But Prime Minister John Key has said if none of the products re-emerge, it would be no bad thing.
All political parties, except the Greens, supported the law change.
The Greens abstained, saying they were pleased the Government had taken animal-testing off the table but they could not support the knee-jerk approach to drug policy.
Mr Ryall has warned against anyone looking to stock up on products before they are pulled from shelves.