The Scottish Government insists the legislation – introduced in an act two years ago – is vital to protect future generations from the "devastating effects" of smoking.
However, Imperial Tobacco – the firm behind brands such as Lambert & Butler and Richmond – asked the Supreme Court in London to analyse the issues after twice failing to persuade Scottish judges to set aside legislative provisions.
Imperial argued there was no credible evidence that display bans have cut tobacco consumption. It said legislative provisions dealing with display bans fall outside the scope of the Scottish Parliament and are matters reserved for Westminster.
However, a panel of five Supreme Court justices yesterday unanimously dismissed the appeal, ruling the two sections were "within the legislative competence of the Scottish Parliament".
Ministers now intend to outlaw vending machines in Scotland and introduce a display ban in large shops in April.
Michael Matheson, the Scottish Minister for Public Health, said: "This 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."
He added: "We will be looking to recover the legal fees incurred to the taxpayer as a result of this court case.
"Given this legislation was passed more than two years ago, and is already in force in England, Wales and Northern Ireland, there are strong arguments to introduce it immediately. But I have always been clear on the need to allow retailers sufficient time to make necessary changes."
Imperial sought a judicial review of display ban plans after a judge at the Court of Session in Edinburgh ruled against the firm in September 2010.
The company appealed but three Scottish judges rejected the challenge in February.
At the Supreme Court in London, Imperial Tobacco argued 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.
Dismissing the challenge, Lord Hope stated 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".
He 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."