European Court of Justice Advocate General Leendert Geelhoed said the EU health foods directive infringed guidelines in his opinion.
But he said he was not opposed to the legislation in principle – opening the way for officials to redraw it.
The court has to make a final decision on the rules, which critics say will ban thousands of health foods.
Judges do not have to agree with the advocate general, although in the majority of cases they do.
The Food Supplements Directive, approved by EU governments in 2002, is designed to tighten controls on the growing market in products sold under the health food heading – natural remedies, vitamin supplements and mineral plant extracts.
Under the new rules, only vitamins and minerals on an approved list can be used in supplements. There will also be restrictions on the upper limits of vitamin doses.
The case was brought by industry groups the British Health Food Manufacturers Association (HFMA), National Association of Health Stores (NAHS) and Alliance for Natural Health (ANH) ahead of the law change in August.
The industry had argued the legislation threatened 5,000 products, containing more than 200 nutrients, including some vitamin C products.
UK companies were supported by the Conservative Party and actress Jenny Seagrove, star of the TV mini-series Woman of Substance.
Andrew Lockley, head of public law at Irwin Mitchell and legal adviser to the HFMA and NAHS, said the advocate general’s decision was encouraging.
“What the advocate general was saying was that the law was disproportionate and unfair.
“It is good news for British consumers and companies, and hopefully the final ruling will reflect what he has said.”
ANH executive director Dr Robert Verkerk said: “All that we are campaigning and working cooperatively for is the right for consumers to have access to safe natural healthcare and for legislation to be based on good science and good law.”
And Shadow Health Minister Chris Grayling added: “This is not the final ruling, but I am confident we are in a position where we’re close to winning the battle to scrap this controversial measure, which would have banned hundreds of vitamins from our shelves.”
The advocate general said the directive as it stands infringed the principles of proportionality, legal protection, legal uncertainty and sound administration.
Philip Tod, a spokesman on health and consumer protection at the European Commission, said the advocate general’s opinion would be noted, but added no further comment could be made until the final ruling.
The court is expected to reach a final decision by July.
The legal action was initially started in the UK courts, and last year the High Court ruled it could be referred to the European Court of Justice. BBC