But European Court of Justice advocate general Yves Bot said the move risked infringing EU rules on free trade.
In an official opinion, he said it would only be legal if it could be shown no other mechanism could deliver the desired public health benefits.
Scotland’s First Minister Nicola Sturgeon welcomed the opinion, saying it confirmed that minimum unit pricing was not precluded by EU law.
The Scottish government, which has argued that minimum pricing is vital to address Scotland’s “unhealthy relationship with drink”, has been unable to implement the policy while the legal process is ongoing.
‘Barrier to trade’
The Scottish legislation was challenged by the Scottish Whisky Association (SWA) in 2013, when it argued that it acted as a barrier to trade.
Its legal bid was initially rejected by judge Lord Doherty at the Court of Session in Edinburgh.
But following an appeal hearing, the case was referred to the European court in Luxembourg last year.
In an opinion released on Thursday, Mr Bot said a minimum unit pricing (MUP) system risked infringing the principle of the free movement of goods and would only be legal if it could be shown that no other mechanism was capable of achieving the desired result of protecting public health.
He stated that “a Member State can choose rules imposing a minimum retail price of alcoholic beverages, which restricts trade within the European Union and distorts competition, rather than increased taxation of those products, only on condition that it shows that the measure chosen presents additional advantages or fewer disadvantages by comparison with the alternative measure”.
The European court is expected to take up to six months to issue its final ruling, before the case is referred back to the Court of Session in Edinburgh.
First Minister Nicola Sturgeon said: “We welcome this opinion, in which the advocate general confirms that minimum unit pricing is not precluded by EU law, but sets out tests that the national court has to apply.
“Importantly, this initial opinion indicates it will be for the domestic courts to take a final decision on minimum unit pricing.
“The advocate general finds that the policy can be implemented if it is shown to be the most effective public health measure available.
“As such, the legal process is ongoing and we await a final response from the European Court of Justice, before the case returns to the Scottish courts.
“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 to reduce the harm that cheap, high-strength alcohol causes our communities.”
The Scotch Whisky Association welcomed the advocate general’s opinion.
Chief executive David Frost said: “The opinion encourages us in our long-held view that MUP is illegal when there are less trade-restrictive measures available.
“We await the Court of Justice’s final ruling.”
Tennent Caledonian Breweries, which backs MUP, urged the Scottish government to “continue to show leadership”.
Managing director Alastair Campbell said: “Minimum pricing is an important step in addressing the very specific but damaging problem of strong, cheap alcohol.
“It would be a lost opportunity for Scotland if it were not introduced.”
Scottish Conservative health spokesman Jackson Carlaw said: “After two-and-a-half years the Scottish government has not been able to introduce minimum pricing and today’s ruling from the European Court hardly makes matters any clearer.
“Assurances at the time that there was no legal case to answer were clearly overly optimistic.
“Even if minimum pricing does finally jump all the legal hurdles it is far from clear if it will then be supported by the European Commission.”
Scottish Green MSP Patrick Harvie criticised the whisky body for “delaying the introducing of minimum pricing for alcohol”.
He added: “The stymying of minimum pricing by a lobby group representing big drinks multinationals mirrors the tactics of the tobacco industry when it tried to stop life-saving legislation.
“Today’s statement from the European Court is disappointing and we must hope that wiser heads prevail when the final judgement is issued.”