SACRAMENTO, Calif. — California lawmakers sent the governor a bill Wednesday that would give new wage and benefit protections to workers at so-called gig economy companies such as Uber and Lyft where people pick up jobs on their own schedule.

The 56-15 Assembly vote marked a victory for labor unions and a defeat for tech companies that vehemently oppose the proposal.

Democratic Gov. Gavin Newsom has already said he supports it.

If signed, the proposal could have national implications as politicians and businesses confront the changing nature of work in the so-called gig economy.

In a rare injection of presidential politics into a state issue, most of the major Democratic presidential contenders urged California lawmakers to pass the bill and have championed similar proposals in their campaigns.

”This isn’t perfect, but I think this goes a long way to protecting workers, legitimate small businesses, legitimate businesses that play by the rules, and we as taxpayers that have to clean up the mess when these businesses don’t provide enough for their workers,” said the author of the bill, Democratic Assemblywoman Lorena Gonzalez, her voice shaking with emotion Wednesday.

Newsom is committed to continuing talks on other refinements even after he signs the bill, said governor’s spokesman Nathan Click,

The state Senate passed the measure with a 29-11 vote late Tuesday over strident Republican opposition.

The bill has drawn staunch opposition from on-demand delivery and ride-hailing companies that say it will effectively kill their business model.

Drivers are divided on the issue.

By picking which industries can use independent contractors and which workers must be treated as employees, “we are playing a political Russian roulette with their lives, their livelihood and their labor,” said Republican Assemblyman Jim Patterson of Fresno.

The bill would put into law a California Supreme Court decision making it harder for companies to classify workers as independent contractors and instead would make them classify the workers as employees.

While its impact on gig economy companies has drawn most of the attention, it would affect a wide array of industries.

”Today these so-called gig companies present themselves as the so-called innovative future of tomorrow,” Democratic Sen. Marie Elena Durazo of Los Angeles said as she presented the bill in the Assembly late Tuesday. “Let’s be clear. There is nothing innovative about underpaying someone for their labor.”

The law lays out a test to decide if workers can be labeled as contractors. The worker must be free from control of the company, perform work “outside the usual course of the hiring entity’s business,” and be engaged in an independently established trade, occupation or business of the same nature of the work they are performing.

Uber, Lyft and meal delivery companies such as Doordash and Postmates still hope Newsom can negotiate a new proposal with unions that would create a separate set of rules for gig workers.

They have proposed a base hourly for workers, paying into a fund for benefits including accident coverage and allow for “sectoral bargaining,” where workers across the industry could organize. Several of the companies have threatened to spend $90 million on a ballot measure next year if they do not get their way.

They’ve argued that making their workers employees would limit workers’ abilities to work flexible hours of their choosing.

Gonzalez says nothing in the law forces the companies to eliminate worker flexibility. As employees, the workers would be entitled to minimum wage and benefits such as workers compensation, unemployment insurance and paid leave.

Federal law still considers gig workers independent contractors, so it’s unclear if a state law making them employees would allow workers to unionize.

Sen. Mike Morrell of Rancho Cucamonga was among Republican opponents of the bill, many of whom told emotional stories of their own entrepreneurial success.

”This is just another assault on the free market, and again, it is a slouch toward socialism when government controls what business does,” Morrell said.