The Health Ministry has recalled a popular brand of the synthetic cannabis, Kronic.
Director-General of Health Kevin Woods warned retailers to remove from shelves herbal smoking product Kronic Pineapple Express because it contains a prescription medicine.
Supplier Lightyears Ahead said the substance was not meant to be in the product and it would investigate the "contamination". In a statement it said it would fully cooperate with the ministry.
Mr Woods said people should not consume the product and should seek medical advice if they felt unwell.
Kronic Pineapple Express contained a benzodiazepine called phenazepam that was not available in New Zealand and only appeared to be used in one country for the short term treatment of anxiety and as an anticonvulsant.
Phenazepam can only be legally supplied when prescribed by a doctor or other prescriber.
The recall makes it illegal to buy, sell, use or possess without a doctor's prescription.
Kronic is marketed as "legal weed" and its creators say there have never been reports of negative side-effects in the seven years it has been on the market.
The product was this month banned in Western Australia, while Tasmania and Queensland have announced plans to tighten restrictions.
The ministry will meet the company importing and manufacturing the product today and wanted retailers to immediately remove it from sale.
Kronic Pineapple Express is one of a number of branded herbal smoking products containing synthetic cannabinoids.
The presence of the prescription medicine was first suspected from a screening test last month but it took a month to verify.
A similar product is also being investigated and further action may be taken shortly.
Testing of a total of around 40 of these products by Environmental Science and Research (ESR) is currently being undertaken.
Lightyears Ahead Limited said in its statement that the amount of phenazepam found was very small, 300 parts per million.
"Kronic Pineapple Express is not intended to contain, and Lightyears was not aware that it contain, phenazepam," the statement said.
"On the request of the Ministry of Health, Lightyears is immediately withdrawing Kronic Pineapple Express from sale. Retailers and distributors are requested to immediately return all unsold Pineapple Express product to Lightyears."
The company said it would fully cooperate with ministry requests and would carry out its own investigation to find out how the phenazepam got into the product.
Associate Health Minister Peter Dunne said the finding of phenazepam confirmed the dangers of suppliers putting unregulated drugs on the market where their safety was unproven.
"This clearly shows the worth of the Government's moves to change the onus of proof so producers and suppliers of these products need to prove they are safe before they can sell them," he said.
At the moment it is up to authorities to prove products were unsafe before they could be taken off the market.
He said the Government would in coming weeks place restrictions on the sale and marketing of products such as those containing synthetic cannabinoids in proposed amendments to the Misuse of Drugs Act.
Smokefree legislation means that it is already illegal to sell these products to those under 18.