California now requires police to get a court order before they can search messages, photos and other digital data stored on phones or company servers in the nation's most populous state.
Civil liberties advocates called the new law an important advance and said it highlights the need for similar protections at the national level.
The California Electronic Communications Privacy Act was signed into law by Gov. Jerry Brown on Thursday. It's only the third of its kind in the U.S.
While some states guarantee some of its protections, only Maine and Utah previously had comprehensive laws on the books, noted Hanni Fakhoury, senior staff attorney for the Electronic Frontier Foundation.
"It's an expansive bill and this being California, it covers a lot of people," Fakhoury said of the state with a population of about 39 million. "It's an important thing and a good development."