A top European court on Thursday ruled against restrictions imposed by Barcelona city hall on ride-hailing companies like Uber and Cabify.
Spain's second largest city has in recent years granted just one licence for vehicles with drivers (VTCs) for every 30 licences awarded traditional taxis.
The restriction was imposed in response to protests from Barcelona's taxi drivers who said Uber and its Spanish rival Cabify were operating with an unfair advantage.
Ride-hailing firms have challenged the restrictions in the courts.
The Luxembourg-based Court of Justice of the EU (ECJ) ruled Thursday that the rules violated ride-hailing firms' "freedom of establishment" in the city.
They "effectively limit market access to all newcomers and... the number of VTC service providers established" in Barcelona, the court added in its ruling.
The court acknowledged that requiring licences "can be considered necessary to achieve the goals of good management of transport, traffic and public space."
But it said licences should be issued on "objective, non-discriminatory and previously known criteria".
"The objective of ensuring the economic viability of taxi services... cannot constitute one of those reasons," the court said.
The rise of ride-hailing platforms like Uber has sparked conflict in many cities around the world in recent years.
Several protests were held in Barcelona in 2018 and 2019 which were marred by clashes between taxi drivers and drivers of ride-hailing companies.
vab/ds/rl