The UK's highest court rejected a challenge by Imperial Tobacco against the Scottish Government's attempts to ban the open display of cigarettes in shops in Scotland.
The five-judge panel, headed by Lord Hope, who has previously clashed with the First Minister over judicial affairs and the role of the Supreme Court, said it was competent for ministers to proceed with the pioneering legislation.
Scottish Minister for Public Health Michael Matheson said the ruling cleared the way for the ban's introduction, which is planned for spring next year.
Earlier, at a hearing in London, lawyers representing Imperial, one of the world's biggest tobacco firms and based in Bristol, had asked the Supreme Court justices to analyse the issues after twice failing to persuade Scottish judges to set aside legislative provisions.
Ministers say display bans are needed to protect future generations from the "devastating effects" of smoking.
Imperial said there is no credible evidence that display bans have cut tobacco consumption. The firm also argued that the legislative provisions dealing with display bans fall outside the scope of the Scottish Government and are matters reserved for the UK Parliament in London.
Imperial, the firm behind Lambert & Butler and Richmond cigarette brands, was also opposing a ban on tobacco vending machines.
At the Supreme Court, Imperial argued that sections 1 and 9 of the Tobacco and Primary Medical Services (Scotland) Act 2010 were "outside the legislative competence of the Scottish Parliament".
Section 1 prohibits the display of tobacco products in a place where they are offered for sale and section 9 prohibits vending machines for the sale of tobacco products.
Today, the justices unanimously dismissed Imperial's appeal, ruling that the two sections "are within the legislative competence of the Scottish Parliament".
Announcing the decision of the court, Lord Hope said: "The purpose of section 1 is to enable the Scottish ministers to take steps which might render tobacco products less visible to potential consumers and thereby achieve a reduction in sales and thus in smoking.
"The purpose of section 9 is to make cigarettes less readily available, particularly (but not only) to children and young people, with a view to reducing smoking. The legal effect and short-term consequences are consistent with those purposes."
He said the court "does not see how it can be said that the purpose of sections 1 and 9 has anything to do with consumer protection".
Lord Hope added: "The aim of sections 1 and 9 is to discourage or eliminate sales of tobacco products, not to regulate how any sales are to be conducted so as to protect the consumer from unfair trade practices.
"The purpose of sections 1 and 9 also has nothing to do with the standards of safety to be observed in the production and sale of tobacco products.
"Sections 1 and 9 are designed to promote public health by reducing the attractiveness and availability of tobacco products, not to prohibit in any way their sale to those who wish and are old enough to purchase them."
Imperial's civil court challenge has delayed the implementation of measures aimed at stopping people smoking.
Ministers had intended to introduce the display ban in large shops in Scotland - the first part of the UK to adopt a ban on smoking in public places - in April.
Imperial initially sought a judicial review of ministers' plans for display bans.
A judge in Scotland ruled against the firm in September 2010. Imperial appealed but three judges rejected the challenge in February.
That decision was welcomed by Scotland's public health minister, Michael Matheson, who said the proposals would play a "crucial role" in preventing youngsters from starting to smoke.
But Imperial voiced disappointment and appealed to the Supreme Court.
Scottish Minister for Public Health Michael Matheson said: "Today's judgment removes the final barrier to fully implement the Tobacco and Primary Medical Services (Scotland) Act 2010 and maintain Scotland's position as a world leader on tobacco control.
"We know that reducing the number of people that smoke will have wide benefits for Scotland's health and these bans will play a crucial role in preventing young people from taking up smoking.
"We will be looking to recover the legal fees incurred to the taxpayer as a result of this court case.
"Given that this legislation was passed over two years ago and is already in force in England, Wales and Northern Ireland, there are strong arguments to introduce it immediately. However, I have always been clear on the need to allow retailers sufficient time to make the necessary changes and so we have decided that April 2013 represents a fair timescale for implementing the display ban.
"The introduction of the ban on vending machines will be in line with our commitment to provide a four-month implementation period."
Sheila Duffy, Chief Executive of ASH Scotland, said: “The banning of glitzy tobacco displays and unstaffed vending machines takes us one step closer to a society where our young people do not feel pressured or tempted to take up smoking. By attacking these legitimate health measures Imperial Tobacco has revealed its own naked self-interest and continued a long tobacco industry tradition of putting profit before the protection of young people.
“Given that about 40 young Scots take up smoking every day, these repeated legal challenges mean that 40,000 young Scots will have taken up smoking since this legislation was passed. There must be no further delays and I look forward to these life-saving measures being implemented.
“Scottish Ministers should be congratulated for facing down these bullying tactics from the tobacco industry, and for producing stronger restrictions on tobacco displays than elsewhere in the UK.”