Barcelona has outlawed new city centre hotels as part of a plan to curb excessive tourism.
New tourist apartments are also to be prohibited as the city seeks to reduce visitor numbers to what has become one of the most popular destinations in Europe.
Nearly 20 million overnight visitors stayed in the city last year, with locals increasingly concerned about the stresses placed on local infrastructure.
Complaints range from the bad behaviour of travellers to the spiralling cost of housing.
Under the new legislation, if any hotel or apartment closes its capacity cannot be replaced.
“We are delighted that so many people want to visit us but what is at stake now is the very city that we all admire.
“We need regulation and we need a better equilibrium,” said Janet Sanz, a member of the Barcelona local government.
Barcelona ranks fifth in Europe for overnight visitors behind London, Paris, Berlin and Rome.
However, many of its most famous sites are clustered in the relatively small city centre in and around the Barrio Gótico.
Critics argue this has left the city with the sort of overcrowding challenges faced by tourist hotspots such as Venice and the Vatican.