California governor Jerry Brown has signed the United States’ toughest net neutrality measure which requires internet providers to maintain a level playing field online.

The move prompted an immediate lawsuit by the Trump administration.

Advocates of net neutrality hope the move in the home of the global technology industry will have national implications, prompting Congress to enact national net neutrality rules or encouraging other states to follow suit.

But the US Department of Justice wants to stop the law, arguing that it creates burdensome, anti-consumer requirements that go against the federal government’s approach of deregulating the internet.

“Once again the California Legislature has enacted an extreme and illegal state law attempting to frustrate federal policy,” US Attorney General Jeff Sessions said in a statement.

The law is the latest example of the nation’s most populous state seeking to drive public policy outside its borders and rebuff president Donald Trump’s agenda.

Mr Brown did not explain his reasons for signing the bill when the decision was announced.

It is set to take effect on January 1.

“This is a historic day for California. 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,” said Democratic Senator Scott Weiner, the law’s author.

The Federal Communications Commission last year repealed rules preventing internet companies from exercising more control over what people watch and see on the internet.

California’s law seeks to reinstate those rules.

Telecommunications companies lobbied hard to kill the bill or water it down, saying it would lead to higher internet and mobile phone bills and discourage investments in faster internet.

They say it is unrealistic to expect them to comply with internet regulations that differ from state to state.

USTelecom, a telecommunications trade group, said California writing its own rules would create problems.

“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,” the group said in a statement.

Net neutrality advocates worry that without rules, internet providers could create fast lanes and slow lanes that favour their own sites and apps or make it harder for consumers to see content from competitors.

That could limit consumer choice or shut out upstart companies that cannot afford to buy access to the fast lane, critics say.

The new law prohibits internet providers from blocking or slowing data based on content or from favouring websites or video streams from companies that pay extra.

It also bans “zero rating”, in which internet providers do not count certain content against a monthly data cap — generally video streams produced by the company’s own subsidiaries and partners.

Oregon, Washington and Vermont have approved legislation related to net neutrality, but California’s measure is seen as the most comprehensive attempt to codify the principle in a way that might survive a likely court challenge. An identical bill was introduced in New York.