An appeals court has upheld the Federal Communications Commission’s repeal of net neutrality laws, but it vacated a rule that would prevent states from passing their own. The decision mostly marks a defeat for Mozilla, which sued the agency last year. But it’s tentatively positive for states like California, which has been fighting for the right to impose stricter net neutrality laws.

The District of Columbia Court of Appeals says the FCC had authority to reclassify internet service providers as “information services” under Title I of the Telecommunications Act, rather than “common carriers” that can be more heavily regulated. It wasn’t persuaded by most of the arguments against this change, but it noted three areas where the FCC hasn’t adequately defended itself.

The court said the FCC exhibited “disregard of its duty” to evaluate how its rule change would affect public safety. Public safety was a key issue in a hearing earlier this year, with net neutrality advocates arguing that the FCC’s decision let ISPs throttle first responders’ data — something that happened in California last year. “The harms from blocking and throttling during a public safety emergency are irreparable. People could be injured or die,” reads the ruling, which orders the FCC to address these safety concerns.

The FCC also didn’t sufficiently explain what the rules would mean for utility pole access — which can make it easier for new competitors to set up internet service networks — and didn’t address concerns about how the change would affect the Lifeline internet access program for low-income Americans.

And most notably, the court vacated a section of the rules that let the FCC preempt any stricter state net neutrality laws. The FCC has previously filed suit against states that passed their own net neutrality rules.

FCC chair Ajit Pai celebrated the ruling on Twitter. “Today’s D.C. Circuit decision is a big victory for consumers!” Pai wrote. “The court affirmed the FCC’s decision to repeal 1930s utility-style regulation of the internet.” In an official statement, he also said he “look[s] forward to addressing ... the narrow issues that the court identified.”

Mozilla also released a statement responding to the decision. “Our fight to preserve net neutrality as a fundamental digital right is far from over. We are encouraged to see the court free states to enact net neutrality rules that protect consumers,” it says. “We are considering our next steps in the litigation around the FCC’s 2018 Order, and are grateful to be a part of a broad community pressing for net neutrality protections in courts, states and in Congress.”