California Governor Jerry Brown has approved a digital privacy bill that protects people from government access to private electronic communications without a warrant.

The new law, backed by a number of tech companies and civil liberties groups, requires a judge to approve such access to a person’s private information, including data from personal electronic devices, email, digital documents, text messages and location information.

The state houses the headquarters of a number of technology companies, including Google, Apple, Facebook and Twitter, some of whom are seeing a jump in requests from state and federal law enforcement agencies for information on their customers.

California Electronic Privacy Act (CalECPA, SB 178) was passed in September by the state assembly after the senate passed it in June. The bill was co-sponsored by the American Civil Liberties Union of California, Electronic Frontier Foundation and California Newspaper Publishers Association.

While providing some exceptions for law enforcement in emergencies or for other public safety requirements, the law also prohibits access to electronic device information by means of physical interaction or electronic communication with the device, except with the specific consent of the authorized possessor of the device, or through other relevant provisions such as a warrant.

The bill was jointly authored by Senators Mark Leno, a Democrat from San Francisco, and Joel Anderson, a Republican from Alpine.

The new law allows government entities to obtain information in an emergency "involving danger of death or serious physical injury to a person," that requires access to the electronic information without delay, but the law enforcement agency will have to file within three days with the appropriate court an application for a warrant or order authorizing obtaining the electronic information or a motion seeking approval of the emergency measures, according to the bill passed by both houses.

The state's major law enforcement agencies withdrew their opposition to the bill after months of negotiations, with the San Diego Police Officers Association giving its endorsement to S.B. 178, holding that clear processes for obtaining data would improve their ability to do their jobs, while also protecting privacy, according to the EFF.

California joins states like Texas, Virginia, Maine, and Utah that have updated their privacy laws to require judicial oversight, including a warrant, for access to sensitive digital information, according to the backers of the new law.

“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 Thursday. The new law changes that, he added.