Image copyright Getty Images

Seattle has passed a measure allowing drivers of smartphone-based taxi services such as Uber to join a union.

The move - a first in the US - is a setback for the companies, which have sought to avoid regulations that apply to traditional taxi services.

Companies such as Uber say their drivers are independent contractors and do not pay for their health benefits, fuel or vehicle upkeep.

The companies have vowed to challenge the legislation in court.

"My intent is to make sure that the people, the drivers, the workers in our community continue to have access to good wage jobs," said Seattle council member Mike O'Brien.

Saad Melouchi, 30, who drives for Uber, said: "This is amazing. I'm so happy for myself and for other drivers."

The measure, which was passed unanimously by the city council to cheers, allows the drivers to collectively bargain with the companies on issues such as pay and working conditions.

However, Uber, Lyft and others argue that federal labour law prohibits cities from regulating collective bargaining.

The ordinance could also allow drivers to set rates, violating federal antitrust laws, the companies said.

Image copyright Reuters Image caption Many Seattle Uber drivers who the support the plan to form a union attended the City Council vote

Opponents say the measure will costly and difficult for Seattle to carry out.

The city's council leaders have been a strong advocate of workers' rights, recently enacting a $15 an hour minimum wage and requiring most employers to provide sick leave.

Mayor Ed Murray said he supported union rights for workers but had concerns about the measure. He anticipated a costly legal battle with the companies.

Uber also faces legal action in California on behalf of drivers who want to be considered full-time employees rather than contractors.