California continued its long-standing tradition for forward-thinking privacy laws today when Governor Jerry Brown signed a sweeping law protecting digital privacy rights.

The landmark Electronic Communications Privacy Act bars any state law enforcement agency or other investigative entity from compelling a business to turn over any metadata or digital communications—including emails, texts, documents stored in the cloud—without a warrant. It also requires a warrant to track the location of electronic devices like mobile phones, or to search them.

The legislation, which easily passed the Legislature last month, is the most comprehensive in the country, says the ACLU.

“This is a landmark win for digital privacy and all Californians,” Nicole Ozer, technology and civil liberties policy director at the ACLU of California, said in a statment. “We hope this is a model for the rest of the nation in protecting our digital privacy rights.”

Five other states have warrant protection for content, and nine others have warrant protection for GPS location tracking. But California is the first to enact a comprehensive law protecting location data, content, metadata and device searches, Ozer told WIRED.

"This is really a comprehensive update for the modern digital age," she said.

State senators Mark Leno (D-San Francisco) and Joel Anderson (R-Alpine) wrote the legislation earlier this year to give digital data the same kinds of protection that non-digital communications have.

"For what logical reason should a handwritten letter stored in a desk drawer enjoy more protection from warrantless government surveillance than an email sent to a colleague or a text message to a loved one?" Leno said earlier this year. "This is nonsensical and violates the right to liberty and privacy that every Californian expects under the constitution."

The bill enjoyed widespread support among civil libertarians like the American Civil Liberties Union and the Electronic Frontier Foundation as well as tech companies like Apple, Google, Facebook, Dropbox, LinkedIn, and Twitter, which have headquarters in California. It also had huge bipartisan support among state lawmakers.

"For too long, California’s digital privacy laws have been stuck in the Dark Ages, leaving our personal emails, text messages, photos and smartphones increasingly vulnerable to warrantless searches," Leno said in a statement today. "That ends today with the Governor’s signature of CalECPA, a carefully crafted law that protects personal information of all Californians. The bill also ensures that law enforcement officials have the tools they need to continue to fight crime in the digital age."

The law applies only to California law enforcement entities; law enforcement agencies in other states would be compelled by the laws in their jurisdictions, which is why Ozer and others say it's important to get similar comprehensive laws passed elsewhere.

The law places California not only at the forefront of protecting digital privacy among states, it outpaces even the federal government, where such efforts have stalled.

Civil libertarians and others have long lobbied federal lawmakers to update the Electronic Communications Privacy Act to offer such protection nationwide. An amendment to that law has been wending through Capitol Hill, where it has 300 co-sponsors. But the proposal is less comprehensive than the law Brown signed, and would merely focus on digital content. Currently, the federal ECPA requires a warrant for stored content that is newer than 180 days; the amendment would extend the warrant requirement to all digital content regardless of age.

California has long led the way in privacy protection. Voters amended the state constitution in the 1970s to provide explicit privacy rights far more robust than those guaranteed by the Fourth Amendment of the US Constitution. But while the state amendment ensured a right to privacy for all Californians, lawmakers couldn't envision the technological advances that would come in the decades to follow. The law that Brown signed today closes surveillance loopholes left by that amendment and "codifies what was intended by that privacy right," Ozer says.

"We certainly hope that this bill is a clarion call [for the federal amendment]," she told WIRED. "This is not only a comprehensive update for all Californians, but hopefully is a model for making sure that all Americans have this kind of digital privacy protection."