California Governor Gavin Newsom signed legislation Wednesday which could slam the brakes on the so-called "gig economy" by requiring rideshare firms to treat contract drivers as employees, challenging the economic models of giants such as Uber and Lyft.

The legislation, which is being closely watched in other states, responds to critics who argue that rideshare firms shortchange contract drivers by denying them employee benefits.

The new law comes with growing numbers of workers relying on short-term "gigs" which offer greater flexibility but lack the benefits of regular employment.

The governor called the measure known as AB5 "landmark legislation for workers and our economy" and said it would reduce "worker misclassification" that denied benefits such as minimum wage, sick leave and health insurance.

"The hollowing out of our middle class has been 40 years in the making and the need to create lasting economic security for our workforce demands action. Assembly Bill 5 is an important step."

The law challenges the business model of the rideshare platforms and others which depend on workers taking on "gigs" as independent contractors.

The measure was hailed as a watershed moment for labor activists seeking more rights for gig and freelance workers.

"Big thank you to all the gig workers, union members & activists who spent countless hours rallying to deliver this historic win," the California Labor Federal said in a tweet.

State assemblywoman Lorena Gonzalez, author of AB5, lauded its signing as a "massive win" for workers.

"I'm proud to have had a small part in redefining labor law in this state and starting a path to reducing income inequality and rebuilding the middle class."

But the state's Republican Caucus fired off a tweet contending that Newsom signed "California's largest anti-free market legislation" and that it could effect some two million jobs.

Referendum sought

Uber and Lyft, whose business models may be jeopardized by the law, said they would press on for a referendum that would overturn the measure, asking voters to approve a new system for independent workers with benefits.

The rideshare rivals said they have set aside $30 million each to support a ballot initiative next year.

"We've been proudly advocating for a new progressive framework that would for the first time give minimum earnings guarantees, access to benefits, and a right to organize to independent workers," an Uber spokesman said.

"We believe California is missing a real opportunity to lead the nation by improving the quality, security and dignity of independent work."

The two firms are seeking a new classification that considers workers independent while guaranteeing benefits and enabling collective bargaining.

Lyft policy communications director Adrian Durbin said the firms would seek a referendum if there is no negotiated deal with the governor.

"We are confident that with his leadership we can reach a historic agreement, but if necessary we are prepared to take this issue to the voters to preserve the freedom and access drivers and passengers want," Durbin said.

Uber has said it has no plans to immediately reclassify drivers as employees in January, when the law takes effect.

The law "does not provide drivers benefits; give them the right to organize, or classify them as employees," Uber chief legal officer Tony West said on a call last week with reporters.