With few exceptions, police may not look at the contents of a person’s cellphone during an arrest, the U.S. Supreme Court ruled Wednesday in an important privacy rights decision.

“The police generally may not, without a warrant, search digital information on a cell phone seized from an individual who has been arrested,” it unanimously held in Riley v. California, where the Court consolidated two suits involving California police who pulled over drivers and used their cellphone data to later charge them with crimes.

The ruling is a powerful affirmation of the constitutional right to privacy and requirement that police obtain search warrants in our modern digital communication era. Cellphones contain too much private data accumulated over years, which is not the same as police asking someone to empty their pockets, the Court explained:

“Before cell phones, a search of a person was limited by physical realities and generally constituted only a narrow intrusion on privacy. But cell phones can store millions of pages of text, thousands of pictures, or hundreds of videos. This has several interrelated privacy consequences. First, a cell phone collects in one place many distinct types of information that reveal much more in combination than any isolated record. Second, the phone’s capacity allows even just one type of information to convey far more than previously possible. Third, data on the phone can date back for years. In addition, an element of pervasiveness characterizes cell phones but not physical records. A decade ago officers might have occasionally stumbled across a highly personal item such as a diary, but today many of the more than 90% of American adults who own cell phones keep on their person a digital record of nearly every aspect of their lives.”

The Court concluded that personal privacy rights trump police fishing expeditions—or finding something else to charge an arrested person with. It pointed to previous Supreme Court rulings on whether a search warrant was needed and affirmed that privacy rights outweigh police expediency.

“The Court generally determines whether to exempt a given type of search from the warrant requirement “by assessing, on the one hand, the degree to which it intrudes upon an individual’s privacy and, on the other, the degree to which it is needed for the promotion of legitimate governmental interests,” it said, citing an earlier ruling.

California had argued that police needed to look at cellphones and suggested that the Court create rules for doing so. But the Court rejected most of those with a few exceptions. For example, it said cellphones could be examined by police to see if they can be used as a weapon. But it emphasized that did not mean that police could look at the data.

“Digital data stored on a cell phone cannot itself be used as a weapon to harm an arresting officer or to effectuate the arrestee’s escape,” it wrote. “Officers may examine the phone’s physical aspects to ensure that it will not be used as a weapon, but the data on the phone can endanger no one.”

The Court also said that police fears that people who were arrested would erase their phones were not justified, because police can still recover cellphone data—suggesting that broadband companies can asked to turn over all kinds of data—from who have been called to whatever is backed up on the cloud.

“As to remote wiping, law enforcement currently has some technologies of its own for combating the loss of evidence,” the Court said.

California’s contention that police would only look at information relevant to the possible crime was also was rejected by the Court.

“Another possible rule is to restrict the scope of a cell phone search to information relevant to the crime, the arrestee’s identity, or officer safety. That proposal would again impose few meaningful constraints on officers,” the Court said.

Police can still get search warrants quickly, the Court said, and there was a big exception, so-called “exigent circumstances,” where police could examine the content of phones—presumably in violent crimes.

“The warrant requirement is an important component of the Court’s Fourth Amendment jurisprudence, and warrants may be obtained with increasing efficiency,” the Court said. “In addition, although the search incident to arrest exception does not apply to cell phones, the continued availability of the exigent circumstances exception may give law enforcement a justification for a warrantless search in particular cases.”