California will attempt to go it alone in regulating internet access after Gov. Jerry Brown signed a bill Sunday to restore Obama-era regulations barring the telecommunications industry from favoring certain websites.

First, however, the state will have to prevail in a legal fight with the Trump administration's Justice Department, which sued to block California from installing its own rules minutes after Brown signed the bill.

Brown's approval of the net neutrality protections was met with cheers from his Democratic allies, who advocated for SB822 in hopes that California would create a template for other states to follow. The telecommunications industry, which aggressively fought the bill as it worked its way through the Legislature, was expected to challenge the law in court even before the Trump administration acted.

"Under the Constitution, states do not regulate interstate commerce -- the federal government does," Attorney General Jeff Sessions said in a statement. "Once again the California Legislature has enacted an extreme and illegal state law attempting to frustrate federal policy."

San Francisco Democratic state Sen. Scott Wiener, the bill's author, said, "I'm thrilled the bill was signed, but now it's on to the next fight. We will defend this law."

It's the latest battlefront between the Trump administration and California's Democratic-run government. In March, the Justice Department sued to overturn three sanctuary-state laws passed by the Legislature and signed by Brown, including one limiting law enforcement agencies' cooperation with federal enforcement of immigration laws.

This latest fight might be the last one precipitated by an action of Brown's. Sunday was the final day for the termed-out governor to sign or veto 127 pieces of legislation sitting on his desk. The next time the Legislature passes a bill, it will go to a new chief executive.

Wiener introduced the net neutrality bill in January, just a month after the Federal Communications Commission voted to overturn Obama-era regulations that barred internet service companies from favoring websites, including those they have financial ties to, in a way that creates winners and losers.

Supporters said the bill will ensure that internet companies cannot speed up some streams and apps and slow down others, which could steer consumers to certain content to the detriment of competitors who, for example, couldn't afford to pay their way into the fast lane.

"This victory in California is a testament to the power of the free and open internet to defend itself," said Evan Greer, deputy director of the advocacy group Fight for the Future. "And it's a beacon of hope for internet users everywhere who are fighting for the basic right to express themselves and access information without cable and phone companies controlling what they can see and do online."

Opponents of the bill argued that California overreached with its regulations by trying to replace the federal rule. The telecommunications industry says creating state-by-state regulations is impractical, and some companies have said they do not plan to favor certain websites.

"We all support strong and enforceable net neutrality protections for every American -- regardless of where they may live," said Jonathan Spalter, president of the industry group USTelecom. "But this bill is neither the way to get there, nor will it help advance the promise and potential of California's innovation DNA."

Spalter added, "Rather than 50 states stepping in with their own conflicting open internet solutions, we need Congress to step up with a national framework for the whole internet ecosystem and resolve this issue once and for all."

When the FCC repealed net-neutrality rules, it said it was returning to the "light-touch regulatory scheme that enabled the internet to develop and thrive for nearly two decades."

One provision that would be allowed under federal rules, but not California's, is an internet service provider practice called "zero rating." Under it, some websites and apps don't count against a consumer's data allotment.

Opponents view zero rating as a backdoor way of discriminating against online services that don't strike free-data deals with broadband and wireless companies. But proponents say the subsidies help lower-income communities access data services.

FCC Chairman Ajit Pai pointed to that issue in a statement Sunday night.

"Not only is California's internet regulation law illegal, it also hurts consumers," Pai said. "The law prohibits many free-data plans, which allow consumers to stream video, music, and the like exempt from any data limits. They have proven enormously popular in the marketplace, especially among lower-income Americans."