The California Supreme Court on Thursday upheld a voter-approved law that allows Uber and other delivery apps to treat their drivers as independent contractors instead of employees.

The decision on Proposition 22 was unanimous. Approved by 58% of California voters in 2020, and enacted the same year, Proposition 22 gave app-based gig workers some benefits but not full worker protections because the ballot initiative — which gig companies spent more than $200 million to pass — ensures they are not considered employees.

More than 1.4 million Californians are app-based gig workers for companies such as Uber, Lyft, DoorDash and Instacart, according to the industry’s latest estimates.

The court was not considering the pros and cons of the gig economy.

During oral arguments in May in San Francisco, justices zeroed in on whether Proposition 22 was incompatible with California law, which gives the Legislature responsibility over a complete workers’ compensation system. By declaring gig workers independent contractors, Proposition 22 made them ineligible for workers’ comp benefits. SEIU California, the Service Employees International Union that had sought to overturn the law on behalf of four gig workers, argued that this made the law unconstitutional.

Proposition 22 “does not preclude the electorate from exercising its initiative power to legislate on matters affecting workers’ compensation,” Justice Goodwin Liu wrote.

Advocates for gig workers said the ruling was a blow.

“This is a really tragic outcome,” said Veena Dubal, a law professor at UC Irvine who focuses on labor and inequality. “But it’s not the end of the road.” Dubal speculated that labor advocates could put together a proposition of their own, or municipalities and the state could adopt ordinances and laws that are more worker-friendly — such as making it illegal to set different wages for similar work based on algorithmic formulas.

Gig companies backed Proposition 22 in 2020 to win themselves an exclusion from a new state law known as Assembly Bill 5, which would have upended their business models by requiring them to consider their drivers and delivery workers as employees. Last month, Uber lost a legal battle to overturn AB 5 — meaning only Proposition 22 stood in the way of forcing ride-hailing and delivery app companies to comply with it.

Under Proposition 22, gig workers are promised guaranteed minimum earnings of 120% of minimum wage, health care stipends, occupational accident insurance and accidental death insurance. Many of the benefits come with stipulations:

• The guaranteed earnings are based on time on a “gig” and don’t include time workers spend waiting for a ride or delivery.

• The health care stipends are for certain eligible workers only.

• The occupational accident insurance has a $1 million limit

• Gig workers are reimbursed for their mileage, although at less than the IRS-mandated rate employees receive.

• Because Proposition 22 will stand, app-based platform workers will continue to be ineligible for benefits such as sick pay, a minimum wage for all time worked, unemployment insurance and more.