A sign marks a rendezvous location for Lyft and Uber users at San Diego State University in San Diego, California, US, May 13, 2020.

A California state appeals court on Monday revived a ballot measure allowing app-based services such as Uber Technologies Inc and Lyft Inc to treat drivers as independent contractors rather than employees, in a major victory for the industry.

A three-judge panel of the San Francisco-based court reversed a lower court ruling in 2021 that the ballot measure, known as Proposition 22, was unconstitutional.

The appeals court ruling did strike down a provision of Prop 22 that limits the ability of gig workers to join unions, but the ruling was still broadly seen as a win for Uber and Lyft.

Shares of Uber (UBER) and Lyft (LYFT) were up nearly 5% in after-hours trading.

The Service Employees International Union (SEIU) and several gig drivers who challenged Prop 22 will likely appeal the decision to the California Supreme Court, the state’s top court.

Prop 22 was approved in November 2020 by nearly 60% of voters in California. It exempted app-based drivers from a 2019 state law known as AB5 that makes it difficult to classify workers as independent contractors rather than employees.

The issue is critical for gig companies because contractors do not receive the same legal protections as employees and can be up to 30% cheaper, according to several studies.

Prop 22 allows app-based transportation services to classify drivers as independent contractors as long as they are paid a minimum wage while transporting passengers and receive expense reimbursements and healthcare subsidies.

The 2021 ruling striking down Prop 22 found that it violated the state constitution because it limited the legislature’s power to include gig drivers within the scope of California workers’ compensation law.

The appeals court on Monday disagreed. The court, however, found that the provision of Prop 22 limiting the ability of gig workers to join unions and engage in collective bargaining was invalid and severed it from the rest of the ballot measure.

Uber’s chief legal officer, Tony West, said in a statement that the ruling was a victory for gig workers and millions of Californians who voted in favor of Prop 22.

“Across the state, drivers and couriers have said they are happy with Prop 22, which affords them new benefits while preserving the unique flexibility of app-based work,” West said.

But David Huerta, the president of SEIU California, said corporations should not be able to spend millions of dollars to “buy themselves laws.”

“When gig companies can spend over $200 million to pass a law that violates our state’s constitution instead of investing in workers, it’s clear that California needs better safeguards for our democracy,” Huerta said.