SEATTLE — The Seattle City Council voted unanimously to approve a bill allowing drivers for Uber, Lyft and other ride-hailing apps to form unions.

Council members voted 9-0 in favor of the ordinance, the first legislation of its kind in the country. The decision was greeted with cheers in a City Council chamber packed with supporters holding placards that read “Driver Unity.” The measure is likely to be challenged in court.

The vote is a victory for the App-Based Drivers Association, or ABDA, of Seattle, an organization of on-demand contract workers that lobbied with the local Teamsters union for the legislation. It is a fight that other drivers around the country have watched closely; union organizers in California have said that the outcome of the Seattle vote could influence actions taken in their own cities.

One member of the City Council, Nick Licata, called the vote “history-setting in what we’re attempting to do here in terms of advancing the rights of drivers.”