SACRAMENTO, Calif. (AP) — California on Wednesday became the first state to bar mega-retailers from firing warehouse workers for missing quotas that interfere with bathroom and rest breaks under a new law signed by Gov. Gavin Newsom that grew from Amazon’s drive to speed goods to consumers more quickly.

The measure also bars Amazon, the online retail giant, and similar companies from disciplining workers for following health and safety laws and allows employees to sue to suspend unsafe quotas or reverse retaliation. The bill applies to all warehouse distribution centers, though proponents were driven by Amazon’s dominance.

“We cannot allow corporations to put profit over people,” Newsom, a Democrat, said in a news release announcing he had signed the law.

The law, AB 701, was authored by Democratic Assemblywoman Lorena Gonzalez, a lawyer and former labor leader. She accused Amazon of disciplining warehouse workers at the direction of “an algorithm” that tracks employees’ activities and can determine that anything not directly related to moving packages is “off-task.”

“Amazon is pushing workers to risk their bodies for next-day delivery, while they can’t so much as use the restroom without fearing retaliation,” Gonzalez said when the Legislature passed her bill.

Amazon did not respond for requests for comment on her legislation or allegations. The law gives large warehouse employers 30 days to disclose quotas to employees.

Workers who think their quotas lead to unsafe behavior can ask for 90 days’ worth of documentation of how their work speed meets or fails the quota. Any discipline within that 90 days is presumed to be retaliation, as is any discipline within 90 days of an employee complaining to the company or a state agency about an unsafe quota.

Gonzalez cited reports from several labor advocacy groups including the Warehouse Worker Resource Center and the Strategic Organizing Center to assert that Amazon employees are far more likely to suffer serious injuries than those working in other warehouses.

California’s workplace regulators would have to consider investigating if a worksite or employer has an annual employee injury rate at least 1.5 times higher than the warehousing industry’s average annual injury rate, under her bill.

Yesenia Barrera, a former warehouse employee who is now an organizer with the Warehouse Worker Resource Center, recalled the constant pressure to perform and “carrying, bending, reaching, twisting and packing items from 30-60 pounds for hours a day.”

But 27 business organizations led by the California Retailers Association objected that California is home to thousands of warehouse distribution centers that together “provide quality jobs to hundreds of thousands of working-class Californians.”

The groups in a letter to lawmakers cited U.S. Department of Labor data that wages in the transportation and warehousing sector have risen more than 17% in the last year.

Amazon alone says it employs more than 150,000 Californians, including at dozens of “fulfillment centers.”

The legislation is “both burdensome and needlessly overbroad,” the business groups said, arguing that workers are protected by existing occupational safety standards.

In a statement, California Retailers Association President Rachel Michelin said the measure “will exacerbate our current supply chain issues, increase the cost of living for all Californians and eliminate good-paying jobs.”

“With California’s ports facing record backlogs of ships waiting off the coast and inflation spiking to the fastest pace in 13 years, AB 701 will make matters worse for everyone — creating more back-ordered goods and higher prices for everything from clothes, diapers and food to auto parts, toys and pet supplies,” Michelin said.

Warehouse workers in California are a disproportionate 54% Latino and 9.5% Black, according to the Los Angeles County Federation of Labor, which co-sponsored the bill.

It argued those groups also have fewer job options and were more likely to suffer during the coronavirus pandemic that increased consumers’ reliance on online shopping and boosted retailers’ profits.