The ruling comes at a crucial time for Uber. The company’s new chief executive, Dara Khosrowshahi, has said he wants to take the company public as early as 2019. But he must remake a corporate culture marked by internal strife, accusations of sexual harassment in the workplace and the brash style of his predecessor, Travis Kalanick.

Mr. Khosrowshahi also faces a raft of legal and regulatory challenges. London recently stripped Uber of its operating license, citing safety and security concerns, while a British tribunal ruled it could not treat drivers as self-employed contractors. Just last week, court documents showed that federal authorities in the United States were pursuing at least one criminal investigation into the company.

In a statement on the Wednesday ruling, Uber said that it was already operating under the transportation law of most European countries in which it did business, and that the ruling would have little impact. It added that it would continue a dialogue with cities across Europe for its services.

Elite Taxi, the group that brought the case, said in a Twitter post, “Today, taxi drivers have beaten Goliath.”

The Barcelona-based law firm representing Elite Taxi praised the decision and said in a statement that it could be “extrapolated to other businesses that keep trying to avoid legal responsibilities in the services that they provide.”

The case may provide a benchmark for countries seeking to regulate independent workers, who make up as much as 30 percent of the working-age population in the United States and Europe, according to the McKinsey Global Institute. Some worry, though, that such a group could soon become an underclass.

Mohaan Biswas, 24, a student working toward a master’s degree in information technology in London, suffered a broken foot this year after a car knocked him from his motorcycle while he was carrying food for Deliveroo, the online start-up.