SEATTLE — A federal judge on Tuesday dismissed one challenge to Seattle’s first-in-the-nation law allowing drivers of ride-hailing companies such as Uber and Lyft to unionize over pay and working conditions.

The U.S. Chamber of Commerce, which represents Uber and Lyft, sued in March to block the law. U.S. District Judge Robert Lasnik threw out the challenge Tuesday, finding that the city’s law is an appropriate exercise of its authority.

Nevertheless, the law remains on hold. In April, Lasnik issued a temporary order blocking it, and he applied that ruling to the chamber’s case as well as a separate challenge brought by 11 Seattle Uber and Lyft drivers. The order will remain in effect until he rules on the challenge by the drivers, he said.

The Seattle City Council approved the legislation in late 2015. It requires companies that hire or contract with drivers of taxis, for-hire transportation companies and app-based ride-hailing services to bargain with the drivers if a majority shows they want to be represented.

The law was seen as a test case for the changing 21st-century workforce. The city has been a national leader on workers’ rights, gradually raising the minimum wage to $15 and requiring most employers to provide paid sick leave.

Uber’s general manager for the Pacific Northwest, Brooke Steger, promised an appeal in a written statement Tuesday.

“The Court’s decision ignores the serious legal challenges raised in this case about an ordinance that will turn back the clock in Seattle,” Steger said. “If this ruling is allowed to stand, those most adversely affected will unfortunately be thousands of drivers. … This ordinance was never about benefiting drivers or the community but really about helping Teamsters and protecting taxi companies.”

Seattle’s lawyers have argued that allowing drivers to bargain over their working conditions will make the industry safer and more reliable.