Alcohol on the shelves in an off-licence. The Scottish government's plan pushes the basic price of whisky to £14 a bottle. Photograph: Christopher Thomond for the Guardian

A judge has ruled that Scottish government plans to set a minimum price for alcoholic drinks are legal, in a case that will be seen as a significant victory for health campaigners but will spark an appeal by the drinks industry.

The judicial review ruling in the court of session, Scotland's supreme civil court, is a heavy blow for the multibillion-pound drinks industry. The case was backed by two of the largest European wine and spirits organisations: the European Spirits Association and the Comité Européen Des Entreprises Vins, which represents wine-makers.

In a case being closely watched by UK ministers in London, the SWA said it would appeal against the ruling, setting the scene for a protracted legal battle between the industry and the Scottish government which is likely to end up in the European court of justice.

Gavin Hewitt, chief executive of the SWA, confirmed that it would immediately appeal against the decision, along with its European trade body partners. He said the association was "disappointed" and "surprised" at the ruling.

He said the final ruling that would ultimately decide the legality of minimum pricing would come from the European court in Luxembourg: "The crux of the matter has always been the issue of European law; that will remain the issue which will have to be addressed, and which we will be addressing in our appeal."

Hewitt said his association's members were anxious to block the proposals "without a shadow of a doubt. It is a matter of very great importance for them."

He said the SWA was confident of its position. "The view from Europe has been very different to that expressed by the court and we are not alone in having concerns about the legality of minimum unit pricing," Hewitt said.

"The European commission and more than 10 member states have expressed their concerns that minimum unit pricing contravenes European Union trading rules and their opposition to the Scottish proposals."But Dr Brian Keighley, chair of the British Medical Association's Scotland branch, said he was pleased with the ruling and appealed to the drinks trade to accept it without further legal battles.

"The alcohol industry may decide it has grounds for appeal, but I urge them to put people and health before profits and accept the decision of the courts," he said. "Any credible alcohol strategy must have at its heart measures to tackle price and availability. Scotland is awash with cheap alcohol and Scots are paying the price with their health."

Scottish ministers – who see this policy as a major milestone in public health policy similar to the public smoking ban pioneered in Ireland and Scotland – have already conceded that the legal dispute could delay introducing minimum pricing for several years.

Alex Neil, the Scottish health secretary, said he was pleased with the ruling, but indicated it was just the first court case to come. "We welcome today's favourable opinion from the court of session on minimum unit pricing of alcohol," he said.

"We have always believed minimum unit pricing is the right thing to do to tackle Scotland's problematic relationship with alcohol. Minimum unit pricing will target cheap alcohol relative to strength that is favoured by hazardous and harmful drinkers and which contributes to much of the alcohol-related harm we see in Scotland.

"We now look forward to being able to implement minimum unit pricing and making that transformational change in Scotland's relationship with alcohol."

The SWA had argued that introducing minimum pricing was outside the Scottish parliament's legal powers as a devolved government and broke several parts of European law, by conflicting with open border, common market rules.

But Doherty rejected all those grounds, stating that the Alcohol (Minimum Pricing) (Scotland) Act 2012 was within Holyrood's legal powers, while the Act of Union between Scotland and the rest of the UK was not an impediment to the minimum pricing measures. Nor, he said, was it incompatible with EU law.

He said that even if these measures did restrict some imports, they were justified under EU law "on the grounds of the protection of the life and health of humans".

He also ruled that Holyrood "retained competence to introduce minimum pricing notwithstanding the fact that there had been a degree of EU common organisation of the market" for wines, beers and industrial alcohol.