Companies that want to classify their workers as contractors and avoid paying them wages and benefits that state law requires for employees must prove the workers are running their own businesses, the California Supreme Court ruled Monday in a case that could help thousands of drivers for ride-hailing companies like Uber and Lyft, as well as other gig economy workers.

Ruling unanimously in a suit by drivers of a package and document delivery company called Dynamex Operations West, the court said California’s wage laws must be interpreted to protect both workers and competition among ethical businesses.

“Individual workers generally possess less bargaining power than a hiring business” and may face pressure to accept work for substandard pay and working conditions,” Chief Justice Tani Cantil-Sakauye said in the 7-0 decision. She said the state’s “industry-wide wage orders” were also “intended for the benefit of those law-abiding businesses that comply with the obligations” and meant to avoid a “race to the bottom.”

The ruling applies to disputes under state Industrial Welfare Commission orders that set standards for minimum wages and overtime payments required for all workers who are classified as employees, but not for independent contractors. Companies like Dynamex, as well as Uber and Lyft, have classified their drivers as contractors and argued that they have enough control over their working lives — setting their own hours, with the freedom to drive for other companies — to be called independent.

But the court said the company, to justify contractor status, must prove, first, that the worker is free, in everyday tasks, from the company’s “control and direction”; second, that the work is “outside the usual course of the hiring entity’s business”; and third, that the worker is regularly engaged in an independent occupation or business of the same type he or she is performing for the company.

For example, Cantil-Sakauye said, a store that hires an outside plumber to fix a leak, or an electrician to install a new line, could consider them contractors. But a clothing manufacturer that hires seamstresses who work at home to make dresses that the company will sell has hired them to perform work in its usual line of business and must pay them as employees.

The ruling did not address other issues, such as payment of work expenses, workers’ compensation and unemployment benefits, which are covered by separate laws. But Kevin Ruf, a lawyer for about 300 Dynamex drivers who will now be allowed to pursue their case as a class action, said the court’s rationale should help workers seeking employee status overall.

“The court is aware that use of independent contracting has been abused,” Ruf said.

The ruling is “a boost to cases on behalf of gig economy workers,” said attorney Michael Rubin, who filed arguments on behalf of labor unions supporting the drivers. “It places the burden on the employer” to prove contractor status, and “makes it much easier for employees to prevail,” he said.

Dynamex reclassified its drivers as independent contractors in 2004 and was sued in 2005. The case took more than a decade to work its way through the lower courts.

Attorneys for the company were not available for comment. Andrew Livingston, a lawyer for employer organizations in California that filed arguments in support of Dynamex, said the ruling abandoned a standard that California courts had used for 30 years to determine employment status, based largely on how much control a business exercised over wages, hours and working conditions.

“This will create challenges for employers,” Livingston said. “At least for wage and hour purposes, this will increase the number of individuals who are considered employees in California.”

The case is Dynamex Operations West vs. Superior Court, S222732.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter:@BobEgelko