Seattle has become the first US city to allow drivers for Uber, Lyft, and other similar ride-hailing apps to form unions and bargain over pay and working conditions. Welcomed by drivers, the ordinance is expected to be challenged by the companies.

The Seattle City Council voted 8-0 in favor of the legislation proposed by Councilmember Mike O’Brien. It would give independent drivers the same rights employees have under the National Labor Relations Act, such as the ability to organize and bargain collectively.

Until Monday, on-demand drivers were not protected by the federal labor law, as companies like Uber and Lyft do not consider them employees, but rather contractors or partners. Additionally, drivers have not been covered under Seattle’s wage theft, sick leave, or new $15-per-hour minimum wage laws due to their disputed status.

Under the new law, Seattle taxi- and ride-hailing apps and vehicle-dispatch companies are required to provide the city with a list of their drivers, which will then be used by a non-profit organization to contact the drivers as a part of a process to designate a bargaining representative. The organization, most likely a union, will need to gain the support of the majority of a company’s drivers in order to represent them in collective bargaining.

Seattle Mayor Ed Murray said in a statement that he would not sign the ordinance because his concerns “were not adequately addressed in this legislation.” However, he noted that under the City Charter the ordinance does not need his signature to come into force.

“I remain concerned that this ordinance, as passed by the Council, includes several flaws, especially related to the relatively unknown costs of administering the collective bargaining process and the burden of significant rulemaking the Council has placed on City staff,” Murray said.

“As this ordinance takes effect, my administration will begin its work to determine what it will take to implement the law,” he added.

Organizers would have 120 days to demonstrate that “a majority of drivers for a specific company choose to be represented.”

As soon as a representative body is formed, the law requires companies to negotiate with it in order to reach an agreement on wages and work conditions. In case of violations, a company would face a fine and other penalties, but would not lose its license to operate.

The vote is seen as a victory for the App-Based Drivers Association, or ABDA. The Seattle-based organization, which represents hundreds of Uber and drivers from other companies, was created by the Teamsters Local 117 union earlier this year.

According to the ABDA, drivers for app-based companies “have no say over their working conditions.”

“Since I started driving for Uber, Uber has cut our pay without notice, terminated drivers without giving a reason, and blocked our efforts to improve our working conditions. We’re looking for fairness and the ability to earn a living wage,” Peter Kuel, an Uber driver and member of the leadership council of ABDA, said in a statement.

While largely supported by drivers, the ordinance has been strongly opposed by both Uber and Lyft, both of which have previously indicated their intention to challenge such legislation in court. In their defense, Uber and Lyft argue that flexibility and independence are the key advantages they offer their drivers.

“Uber is creating new opportunities for many people to earn a better living on their own time and their own terms,” the company said in a statement. “Drivers say that with flexible and independent work with Uber, 50% of them drive fewer than 10 hours a week, 70% have full-time or part-time work outside of Uber and 65% choose to vary the hours they drive 25% week-to-week.”

Lyft stressed that it gives drivers “the ability to make money in their free time” as they are “in control of where or when they work”.

The company has argued that the ordinance “conflicts with longstanding federal law” and threatens the privacy of drivers.

“Unfortunately, the ordinance passed today threatens the privacy of drivers, imposes substantial costs on passengers and the City, and conflicts with longstanding federal law,” a Lyft spokesperson said, calling on the Mayor and full Council to reconsider the legislation.