A European court has said the Scottish government's case for a minimum unit price for alcohol is contrary to EU law if other tax options exist.
The European Court of Justice ruling instead recommends the introduction of alternative tax measures.
The Scotch Whisky Association (SWA) and First Minister Nicola Sturgeon have both welcomed the ruling.
The legislation to bring in a minimum price of 50p per unit was passed by the Scottish Parliament in May 2012.
A legal challenge was brought by the SWA, which argued the Scottish government's legislation breached European law.
The European court ruling said: "The Court of Justice considers that the effect of the Scottish legislation is significantly to restrict the market, and this might be avoided by the introduction of a tax measure designed to increase the price of alcohol instead of a measure imposing a minimum price per unit of alcohol."
It added: "The court states that it is ultimately for the national court to determine whether measures other than that provided for by the Scottish legislation, such as increased taxation on alcoholic drinks, are capable of protecting human life and health as effectively as the current legislation, while being less restrictive of trade in those products within the EU."
Reacting to the judgement, Ms Sturgeon tweeted: "ECJ opinion on minimum pricing welcome.
"We believe it is most effective way of tackling alcohol misuse. National court will now decide."
Health Secretary Shona Robison added: "This ruling from the Court of Justice of the European Union indicates, importantly, that it will be for the domestic courts to take a final decision on minimum unit pricing.
"While we must await the final outcome of this legal process, the Scottish government remains certain that minimum unit pricing is the right measure for Scotland. We believe it is the most effective mechanism for tackling alcohol misuse and reducing the harm that cheap, high-strength alcohol causes our communities.
"We maintain that minimum unit pricing would target heavy drinkers as they tend to drink the cheap, high strength alcohol that will be most affected by the policy.
"The case will now continue to the Scottish courts, and we look forward to a hearing in the new year to determine the outcome in this case."
David Frost, SWA chief executive, said: "The SWA always said European Union law issues were central to this case, and so it has proved. This settles EU law issues once and for all.
"The court has confirmed that minimum unit pricing is a restriction on trade, and that it is illegal to choose MUP [minimum unit pricing] where there are less restrictive ways of achieving the same end.
"The Scottish courts will now reflect on the implications of the ruling and all the evidence, before issuing a final judgement."
By BBC Scotland's home affairs correspondent Reevel Alderson
Plus ça change, plus ça même chose. Wednesday's ruling from the European Court of Justice (ECJ) is far from the end of a legal process which began in 2012 when the Scottish Parliament passed legislation allowing a MUP for alcohol to be set.
The matter will now return to the Court of Session in Edinburgh, which had asked the ECJ to rule on whether MUP contravenes EU law.
The Scottish judges will have to examine all of the evidence to help them decide whether improvements in public health - which the government says is the desired aim of MUP - could be achieved by other means, notably increasing tax rates.
Ministers have argued that MUP would specifically hit high-strength alcoholic drinks which cause significant problems, particularly among young people.
Whatever the Court of Session decides, it is almost inevitable there will be a further appeal to the UK Supreme Court, either by the Scottish government or the Scotch Whisky Association, whose challenge to the policy has halted its implementation.
Alison Douglas, chief executive of Alcohol Focus Scotland, said the ruling showed Scotland would be able to introduce minimum pricing "provided it is more effective than taxation".
Ms Douglas argued minimum pricing was a better measure than alcohol taxes, which are "limited in their ability to raise the price of the cheapest alcohol to a level that will actually reduce harm".
She also criticised the Scotch Whisky Association, saying it had "blocked the democratic will of the Scottish Parliament and sacrificed public health to protect their members' profits".
The chairman of BMA Scotland, Dr Peter Bennie, added: "The case for minimum unit pricing has always been based on the fact that it achieves what taxation cannot when it comes to reducing the harm caused by alcohol, so the decision of the European Court setting out the test that must be applied to the policy is a welcome one.
"Today's ruling returns the case to the Scottish courts and puts Scotland a step closer to implementing minimum pricing."
Scottish Health Action on Alcohol Problems (Shaap), which represents medical professionals, also welcomed the judgement.
Shaap director Eric Carlin said it "effectively confirms that the Scottish minimum unit pricing policy has to be justified as a regulatory measure to work alongside taxation increases.
"We hope that the Scottish courts will now move quickly to gather evidence to conclude this case and that the Scottish government will then implement this key policy without delay."
Holyrood ministers have previously said minimum pricing was vital to address Scotland's "unhealthy relationship with drink".
Under the plans, the cheapest bottle of wine (9.4 units of alcohol) would be £4.69 and a four-pack of 500ml cans of 4% lager would cost at least £4.
It would mean a 70cl bottle of whisky could not be sold for less than £14.