An appeals court upheld the Federal Communications Commission’s repeal of net neutrality on Tuesday, but carved out an exception that allows states to set their own rules.

The D.C. Circuit Court of Appeals ruled on Tuesday that the FCC has the discretion under the Telecommunications Act of 1996 to deregulate internet service.

The FCC voted 3-2 in December 2017 to repeal net neutrality, which prevented internet providers from throttling or blocking content, or creating “fast-lanes” for certain content providers. Led by chairman Ajit Pai, the commission argued that utility-style regulation of the internet was too heavy-handed.

“Regulation of broadband Internet has been the subject of protracted litigation, with broadband providers subjected to and then released from common carrier regulation over the previous decade,” the court held. “We decline to yet again flick the on-off switch of common-carrier regulation under these circumstances.”

In a statement, Pai hailed the court’s decision.

“Today’s decision is a victory for consumers, broadband deployment, and the free and open Internet,” Pai said. “The court affirmed the FCC’s decision to repeal 1930s utility-style regulation of the Internet imposed by the prior Administration. … A free and open Internet is what we have today and what we’ll continue to have moving forward.”

The FCC’s 2017 rule overturned an Obama administration rule from 2015, which classified internet service as an “telecommunications service” under the 1996 act. The 2017 decision classified it as an “information service,” which exempted internet service from common carrier regulation.

A coalition of internet companies, state attorneys general and public interest groups sued to block the FCC’s net neutrality repeal.

The court rejected the FCC’s move to preempt state regulation of the internet, saying the commission had not presented sufficient evidence to show that state rules would interfere with the FCC’s rule.

California passed its own net neutrality law in 2018, and the Department of Justice sued to block it. The law has been on hold pending the outcome of the D.C. Circuit case. The California rule now figures to take center stage in the ongoing fight over net neutrality.

The court also faulted the FCC for its failure to consider the effects of its rule on local regulation of utility pole attachments, public safety issues, and the Lifeline program, which affords subsidies to low-income internet users. The FCC was ordered to reconsider its rule as to those issues.

Jessica Rosenworcel, an Obama appointee to the FCC, said she hoped the agency would adopt an “open and fair process” on those issues.

“When the FCC rolled back net neutrality it was on the wrong side of the American people and the wrong side of history,” she said. “Today’s court decision shows that the agency also got it wrong on the law. The agency made a mess when it gave broadband providers the power to block websites, throttle services, and censor online content… The momentum around the country is proof the American people are not done fighting for an open internet. I’m proud to stand with them in that fight.”

The Electronic Frontier Foundation, which filed an amicus brief on behalf of the petitioners, said the ruling will allow states to lead the way on net neutrality.

“The court’s decision underscores and clarifies that when the FCC abdicates its responsibility to protect net neutrality, states can fill the void,” said Katharine Trendacosta, EFF’s manager of policy and activism. “California has already taken the lead, passing a gold standard net neutrality state-level bill. Other states can and should follow suit. But Congress must also act to protect net neutrality. The House has already passed the Save the Internet Act, and the Senate needs to do the same.”

U.S. Telecom, a trade group that represents service providers including AT&T and Verizon, applauded the court’s ruling and called on Congress to enshrine the rules of an “open internet” into federal law.

“The court got it right and affirmed what anyone who has been paying attention to Washington’s net neutrality saga knows to be true: the internet is open, ISPs are investing to bring internet users the content they want, and we remain absolutely opposed to anti-consumer practices like blocking, throttling and anti-competitive paid-prioritization,” the organization said. “The fact is the FCC’s 2017 order restored the smarter, more nimble, pro-consumer and bipartisan policy framework that has guided the internet through 20 years of openness and extraordinary growth.”