(Bloomberg) -- Tesla Inc. failed to derail a lawsuit by the California Civil Rights Department accusing the company of engaging in a pattern of racial harassment and bias at its main factory.

A judge on Wednesday issued a ruling throwing out counterclaims by the electric-car maker that the department’s 2022 suit is unlawful. Tesla had claimed state officials didn’t provide adequate information about the civil rights allegations or engage in efforts to resolve the dispute before going to court.

Read More: Tesla Must Face California’s ‘Rampant’ Workplace Racism Suit

Alameda County Superior Court Judge Evelio Grillo said Tesla can revise and refile its claims by Feb. 3.

Before Tesla countersued, Grillo in August denied Tesla’s request to throw out the state’s complaint, which described the Fremont plant as a “racially segregated workplace.” 

California officials alleged that they found widespread evidence of Black workers subject to mistreatment, including harassment, unequal pay, and retaliation, at Tesla’s Fremont plant during a three-year investigation.

Tesla didn’t respond to a request for comment. The company has said it “strongly opposes all forms of discrimination and harassment” and called the state’s suit “misguided” in a blog post before the complaint was filed. 

Tesla is facing numerous workplace discrimination suits, including one filed by a former elevator operator, Owen Diaz, over its treatment of Black employees and subcontractors at the Fremont plant.

Diaz, who won a $137 million jury verdict against Tesla, is scheduled to face off again with the company over monetary damages in March after he refused to accept a judge’s decision that he was entitled to just $15 million.

The case is Department of Fair Employment and Housing v. Tesla Inc., 22CV006830, California Superior Court, Alameda County.

--With assistance from Robert Burnson.

(Updates with details of final ruling)

©2023 Bloomberg L.P.