BRUSSELS — The European Union's top court has ruled that ride-hailing service Uber should be regulated like a taxi company, a decision that could change the way it functions across the continent.

The ruling Wednesday by the Luxembourg-based European Court of Justice stems from a complaint by a Barcelona taxi drivers association.

The Uber app is seen on a smartphone past cabs passing in Barcelona. Quique Garcia / AFP - Getty Images file

The taxi drivers wanted to prevent Uber from setting up in the Spanish city, and said Uber drivers should have authorizations and licenses.

San Francisco-based Uber argued that it should be regulated as a technology service and not a transport company, because it is based on an app that connects drivers to riders.

Related: Inflammatory letter sheds light on Uber's alleged misconduct

The court said in a statement that services like Uber must be classified as "a service in the field of transport." The decision could affect such services around the EU.