A county judge in San Diego has granted a preliminary injunction finding that Instacart has probably misclassified the overwhelming majority of its California workforce.

While it will not have any immediate effect, the injunction represents a critical first step in enforcing the new state law known as “AB5.”

The statute, which took effect earlier this year, attempts to ensure that so-called “gig economy” and other workers are considered employees, rather than unilaterally being declared independent contractors. Under state law, employees are eligible for consideration benefits, including workers’ compensation, unemployment, unionization rights and more. Companies save millions annually by avoiding such financial costs.

“We disagree with the judge’s decision to grant a preliminary injunction against Instacart in San Diego,” the company said Monday night in a statement provided by Instacart spokeswoman Natalia Montalvo.

“We’re in compliance with the law and will continue to defend ourselves in this litigation. We are appealing this decision in an effort to protect shoppers, customers and retail partners. The court has temporarily stayed the enforcement of the injunction, and we will be taking steps to keep that stay in place during the appeals process so that Instacart’s service will not be disrupted in San Diego.”

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

The labor law case, People of California v. Maplebear — Instacart’s official corporate name — was initially brought by the San Diego city attorney in September.

Instacart “avoids paying its ‘shoppers’ a lawful wage,” San Diego City Attorney Mara W. Elliott said late Monday.

The “landmark ruling makes clear that Instacart employees have been misclassified as independent contractors, resulting in their being denied worker protections to which they are entitled by state law,” Elliott said in a statement to NBC News. “We invite Instacart to work with us to craft a meaningful and fair solution.”

Even though the judge’s order was issued Feb. 18, it was not formally served on the parties until Monday. The order will not take effect until Friday, the same day as a hearing related to arbitration, another central issue in this case.

“The ruling on the motion for preliminary injunction is not an adjudication of the ultimate rights in controversy,” San Diego Superior Court Judge Timothy Taylor wrote. “It simply represents the court's discretionary decision whether defendant should be restrained from exercising a claimed right pending trial.”

The judge’s ruling practically invited Instacart to appeal.

“Frankly, the sooner the Court of Appeal can hold forth on these issues, the sooner the parties will have a clear and definite signal of what is expected of them,” Taylor wrote.

Similar companies including Uber have resisted the law and have a multi-pronged approach, including arguing that its drivers are not “core” to its business and should be treated as contractors. Uber has also lead the charge for a new ballot measure that supporters say would “protect flexibility,” while critics say would gut the heart of AB5 and the state Supreme Court ruling that underpins it.

Instacart, in particular, has long faced criticism over its labor practices and related lawsuits. Vanessa Bain, an Instacart shopper in Menlo Park, California, who has now become a vocal critic of the company, and actively organizes for better pay and working conditions for shoppers, says the ruling is “very validating.”

“It feels like for years we’ve been screaming into a void about our work being misclassified employment,” she told NBC News. “Just a few short years ago, a misclassification determination seemed like a pipe dream.”

CORRECTION (Feb. 25, 2020, 5:10 p.m. ET): An earlier version of this article mischaracterized a judicial ruling in the Instacart case. The judge issued a preliminary injunction finding that the company has probably misclassified most of its California workforce; the judge did not rule on the merits of the case, finding that the misclassification has taken place.