SAN FRANCISCO (Reuters) - Seattle on Monday became the first U.S. city to pass a law giving drivers for Uber and Lyft the right to unionize, a new challenge to the ride companies’ success as they confront mounting dissatisfaction over how drivers are treated.

The law approved unanimously by the Seattle City Council recognizes the right of drivers for on-demand ride companies known as Transportation Network Companies, as well as taxi and for-hire drivers, to collectively negotiate on pay and working conditions.

Uber and Lyft both opposed the measure and argue that federal law precludes such local legislation. The law marks a new approach to addressing the heated debate over whether Uber and Lyft drivers ought to have some or all the legal rights of employees, which would substantially increase companies’ costs.

Despite facing regulatory battles in Seattle, both companies have growth in popularity there, with thousands of drivers using the app.

“Unfortunately, the ordinance passed today threatens the privacy of drivers, imposes substantial costs on passengers and the city, and conflicts with longstanding federal law,” said Chelsea Wilson, Lyft public policy communications manager.

Uber said about half its drivers work fewer than 10 hours a week, and there is such a high turnover of drivers that designating them as employees or allowing them to unionize doesn’t make sense.

Uber is widely expected to sue, although Lyft said it did not have plans to sue.

Seattle Councilman Mike O’Brien, who proposed the measure, predicted Uber would sue and said the city had the resources to defend the ordinance.

“We now have a $60 billion organization making a lot of money while some drivers are making less than $3 per hour,” he said.

At least 1,000 drivers have already organized as part of the App-Based Drivers Association.

The Seattle law does not rule on whether drivers are employees or contractors but extends to drivers rights usually reserved for employees.

“It’s a reaction to the employment issue without solving that bigger problem,” said Richard Reibstein, a labor lawyer who runs the independent contractor practice at Pepper Hamilton. “Until such time as their status is resolved in each state, those who are unhappy will seek political action to advance their causes.”

Hundreds of union supporters and drivers packed the city council chambers Monday afternoon.

“It’s pretty much making minimum wage” after deducting costs, said Sean Janaba, 34, of Seattle, who has been driving for Uber for three years. “Things are getting worse.”

The per-mile fare for Uber and Lyft rides in Seattle is $1.35, a little more than half what it was a couple years ago. In other cities, Uber has regularly cut fares to attract passengers.

At least nine states have issued rulings that drivers are independent contractors, but in two separate cases in California, drivers were deemed employees and got unemployment benefits.

Other drivers have sued Uber for misclassifying them as contractors. Uber is facing a class-action suit in California that could include tens of thousands of drivers.

Uber and other opponents to the Seattle ordinance argue that federal law prohibits independent contractors from collective bargaining, since the law only covers employees.

But farm workers and home health care workers, who are also not addressed by the federal law, have been allowed to unionize under state law, which could give Seattle a defense for its action.

To have a city pass such a law, however, “is extremely uncommon,” Reibstein said. Some question whether cities have that legal authority.

There are also federal anti-trust statutes that could be triggered if driver unions are perceived as fixing prices and eroding free market competition.