A new law signed by California Governor Jerry Brown enacts sweeping digital privacy protections, such as imposing a warrant requirement for police to access nearly any type of digital data produced by or contained within a device or service.

Governor Brown had rejected several similar proposals in past years, but on Thursday he signed the California Electronic Communications Privacy Act. Under the law, the government is forbidden from “accessing electronic device information by means of physical interaction or electronic communication with the device.”

The American Civil Liberties Union described the passage of the law as a landmark win.

“Governor Brown just signed a law that says ‘no’ to warrantless government snooping in our digital information. This is a landmark win for digital privacy and all Californians,” said Nicole Ozer, Technology & Civil Liberties Policy Director at the ACLU of California, in a statement. “We hope this is a model for the rest of the nation in protecting our digital privacy rights.”

In Landmark Victory for Digital Privacy, Gov. Brown Signs California Electronic Communications Privacy Act into Law https://t.co/OqLJgrBuBi — Maternal Won (@mumdaplume) October 8, 2015

The law, jointly authored by Senators Mark Leno (D-San Francisco) and Joel Anderson (R-Alpine), reinforces constitutional rights to privacy by ensuring police obtain a warrant from a judge before accessing a person’s private digital information, including email, text messages and online documents, or tracking or searching electronic devices such as cell phones through such methods as “Stingray” surveillance.

Stingray surveillance, named after a popular brand, is a controversial phone surveillance device which can mimic a wireless carrier cell phone tower in order to force all nearby mobile phones and other cellular data devices to connect to it.

“Tell me how a letter in your mailbox should have more protection than an e-mail in the cloud,” said Leno, reported the Sacramento Bee. “It doesn't make sense.”

California's comprehensive law protecting location data, content, metadata and device searches should be the norm http://t.co/h3qEGDp6Z0 — Vikram Kumar (@vikram_nz) October 9, 2015

Law enforcement had raised concerns about the law’s effect on child pornography investigations, but there are exceptions in cases where there is “an emergency involving danger of death or serious physical injury to a person, that requires access to the electronic information without delay.”

An overwhelming majority of Californians (82 percent) said they wanted the police to be required to “get a warrant” for digital information. The bill had attracted support from leading technology companies such as Airbnb, Apple, and Facebook, as well as civil rights organizations and even law enforcement agencies, according to the ACLU.

24 Veterans Affairs police officers sue management over covert surveillance http://t.co/I4Uz1PVys5pic.twitter.com/v9EECnLaR6 — RT America (@RT_America) June 24, 2015

Criticism has been rising as law enforcement took advantage of technological advances and a lag in privacy laws. Police have been criticized for using mobile phones as tracking devices and accessing sensitive emails and text messages without proper judicial oversight. Stingray surveillance was one popular method of doing this.

What "Stingray" surveillance technology is and why you should be worried local police are using (via @RT_America) https://t.co/Gd3yKWE5O0 — ಠ_ಠ ☺ ¯\_(ツ)_/¯ (@StreetTeamAC) August 26, 2015

Technology companies had also complained about law enforcement demanding that they release their users' digital information to them. Google said requests have more than tripled over the last five years, and Twitter reported a 52 percent jump in requests from last year.