The European Court of Justice has ruled that Dutch authorities can bar foreigners from cannabis-selling coffee shops.
The court said the city of Maastricht was within its rights when it passed a 2005 law stopping foreigners entering cafes that sell marijuana.
The law was aimed at curbing so-called drug tourists driving from Belgium and Germany to buy marijuana.
Correspondents say the government wants to extend the restrictions nationwide.
There are some 700 coffee shops in the Netherlands. The cultivation and sale of soft drugs through them is decriminalised but not legal.
The owner of a Maastricht coffee shop had challenged the 2005 law, arguing that the policy breached EU laws on free movement of goods and services.
However, Thursday's ruling said the restrictions still complied with EU law.
"That restriction is justified by the objective of combating drug tourism and the accompanying public nuisance," the court said.
It added that the governments of Belgium, Germany and France had linked drug tourism to public order problems in their own countries.
Cannabis use in the Netherlands is tolerated in small amounts, with possession and purchases limited to 5g (0.2oz) per adult, regardless of the consumer's nationality.
However, the Netherlands' centre-right coalition government plans to turn coffee shops into private members' clubs amid concerns about the threat drug tourism poses to the Dutch way of life.
The BBC's Geraldine Coughlan in The Hague says the ruling could spell the end of the country's 30-year-old soft drugs tourism trade.
This will absolutely deter me from travelling to the Netherlands. To me, this is their greatest draw - a symbol of true freedom. Nanny states need to get their head out of the hole and realise that cannabis is not the greatest of their worries. Peter, Edmonton, Canada
This would not deter me from visiting, but I still think it's an unjust proposal. I am planning to take up postgraduate studies in the Netherlands in a year, and believe that to be discriminated against in any way because of my nationality is absurd, especially in the EU. I have always fashioned myself as an EU citizen, having travelled and lived all over the union, but this seems like a slap in the face. The law of the land should be equal to all people and not be discriminatory because of nationality. Even if these proposals do not go against any EU laws, they go against the principal idea of the EU. Saulius Pakalniskis, Liverpool, UK
All this will achieve is promoting alternative means of getting what is wanted. For example, nationals may sell the service of entering a coffee shop on behalf of a tourist and purchase what is desired. Also, surely it will only boost the street trading? The desired substances are already available, so restricting access to coffee shops that trade in them will only open up the market for other providers. Pointless law. PR stunt at its worst. William Boyce, Galway City, Ireland
Some friends and I had planned on visiting the Netherlands for the 30th birthday of one of our close friends for the specific purpose of trying cannabis in a decriminalised environment. If we were not allowed to make the purchase there would be no reason to make the trip, we can simply take our vacation money to Paris or Rome. Nicole Trim, Grand Rapids, USA
This would stop thousands of Americans from visiting the Netherlands. In fact, I don't recall ever hearing someone saying they were going there without the main point of the trip being Amsterdam and its pot bars. Adam, Atlanta, USA
One of the main reasons to visit is the liberal views of the country, which allow European member state citizens to visit without the overbearing rules and regulations which create the need to travel elsewhere to enjoy the freedom of views that are not available in their own country. If those freedoms were to be removed I for one would be much less likely to visit. D Adamm, Milton Keynes, UK
I'm sorry but if you wish to pass a law telling me where I can go and what I can do and prevent me from doing something - I choose to go elsewhere. So would this stop me from travelling to the Netherlands? Yes. I am not a drug tourist, but I admit I would enjoy the novelty of buying a joint, just to say that I did it. 1frozencanuck, Hamilton, Ontario, Canada
Very interesting. This will stop lots of people from going there. I'm not saying that every tourist smokes, but that adds to the mystique of Amsterdam, together with the red light district and the Dutch people's liberal social attitude. Lets see if this won't be quietly overturned after tourist revenue drops 75% over the next five years. Luke, London, UK