California Gov. Jerry Brown signed a new law Sunday that restores Obama-era regulations forbidding telecommunications companies from favoring certain sites over others in the state. The move effectively means California is trying to go at it alone in regulating the internet in a move that was cheered by advocates of net neutrality that said it would serve as an opening salvo for other states to follow suit.

Others, however, warned a protracted legal battle is pretty much inevitable that could eventually make it to the Supreme Court. In fact, the Justice Department didn’t waste any time Sunday and filed a lawsuit against the new law saying it was up to the federal government to write these types of laws.

“Under the Constitution, states do not regulate interstate commerce—the federal government does,” said Attorney General Jeff Sessions. “Once again the California legislature has enacted an extreme and illegal state law attempting to frustrate federal policy. The Justice Department should not have to spend valuable time and resources to file this suit today, but we have a duty to defend the prerogatives of the federal government and protect our Constitutional order.”

Telecommunications companies had been pushing hard against the bill, saying it was unrealistic to think they could comply with regulations that differ depending on the state. But Democratic leaders had urged Brown to sign the legislation as net neutrality becomes a rallying cry ahead of the midterm elections.

Considering the move comes less than a year after federal regulators did away with net neutrality rules, this marks the latest example of how California is trying to push back against President Trump’s agenda. “This is a historic day for California,” said state Sen. Scott Wiener, who introduced the bill. “A free and open internet is a cornerstone of 21st century life: our democracy, our economy, our health care and public safety systems, and day-to-day activities. While the Trump administration does everything in its power to undermine our democracy, we in California will continue to do what’s right for our residents.”

The measure that Brown signed into law Sunday forbids telecommunication companies from throttling speed or favoring certain sites over others. It also prevents providers from giving out certain content as part of a package that doesn’t count against a monthly data limit. A similar bill has been introduced in New York.