SACRAMENTO — California legislators approved a landmark bill on Tuesday that requires companies like Uber and Lyft to treat contract workers as employees, a move that could reshape the gig economy and that adds fuel to a yearslong debate over whether the nature of work has become too insecure.

The bill passed in a 29-to-11 vote in the State Senate and will apply to app-based companies, despite their efforts to negotiate an exemption. On Wednesday morning, the Assembly gave its final approval, 56 to 15. California’s governor, Gavin Newsom, endorsed the bill this month and is expected to sign it. Under the measure, which would go into effect Jan. 1, workers must be designated as employees instead of contractors if a company exerts control over how they perform their tasks or if their work is part of a company’s regular business.

The bill may influence other states. A coalition of labor groups is pushing similar legislation in New York, and bills in Washington State and Oregon that were similar to California’s but failed to advance could see renewed momentum. New York City passed a minimum wage for ride-hailing drivers last year but did not try to classify them as employees.

In California, the legislation will affect at least one million workers who have been on the receiving end of a decades-long trend of outsourcing and franchising work, making employer-worker relationships more arm’s-length. Many people have been pushed into contractor status with no access to basic protections like a minimum wage and unemployment insurance. Ride-hailing drivers, food-delivery couriers, janitors, nail salon workers, construction workers and franchise owners could now all be reclassified as employees.