WASHINGTON — In a sweeping victory for privacy rights in the digital age, the Supreme Court on Wednesday unanimously ruled that the police need warrants to search the cellphones of people they arrest.

While the decision will offer protection to the 12 million people arrested every year, many for minor crimes, its impact will most likely be much broader. The ruling almost certainly also applies to searches of tablet and laptop computers, and its reasoning may apply to searches of homes and businesses and of information held by third parties like phone companies.

“This is a bold opinion,” said Orin S. Kerr, a law professor at George Washington University. “It is the first computer-search case, and it says we are in a new digital age. You can’t apply the old rules anymore.”

Chief Justice John G. Roberts Jr., writing for the court, was keenly alert to the central role that cellphones play in contemporary life. They are, he said, “such a pervasive and insistent part of daily life that the proverbial visitor from Mars might conclude they were an important feature of human anatomy.”

But he added that old principles required that their contents be protected from routine searches. One of the driving forces behind the American Revolution, Chief Justice Roberts wrote, was revulsion against “general warrants,” which “allowed British officers to rummage through homes in an unrestrained search for evidence of criminal activity.”

“The fact that technology now allows an individual to carry such information in his hand,” the chief justice also wrote, “does not make the information any less worthy of the protection for which the founders fought.”

The government has been on a surprising losing streak in cases involving the use of new technologies by the police. In Wednesday’s case and in a 2012 decision concerning GPS devices, the Supreme Court’s precedents had supported the government. “But the government got zero votes in those two cases,” Professor Kerr said.

The courts have long allowed warrantless searches in connection with arrests, saying they are justified by the need to protect police officers and to prevent the destruction of evidence.

But Chief Justice Roberts said neither justification made much sense in the context of cellphones. While the police may examine a cellphone to see if it contains, say, a razor blade, he wrote, “once an officer has secured a phone and eliminated any potential physical threats, however, data on the phone can endanger no one.”

The possibility that evidence could be destroyed or hidden by “remote wiping” or encryption programs, Chief Justice Roberts wrote, was remote, speculative and capable of being addressed. The police may turn off a phone, remove its battery or place it in a bag made of aluminum foil.

Should the police confront an authentic “now or never” situation, the chief justice wrote, they may well be entitled to search the phone under a separate strand of Fourth Amendment law, one concerning “exigent circumstances.”

On the other side of the balance, Chief Justice Roberts said, is the data contained on typical cellphones. Ninety percent of Americans have them, he wrote, and they contain “a digital record of nearly every aspect of their lives — from the mundane to the intimate.”

He wrote, “According to one poll, nearly three-quarters of smartphone users report being within five feet of their phones most of the time, with 12 percent admitting that they even use their phones in the shower.”

Even the word cellphone is a misnomer, he said. “They could just as easily be called cameras, video players, Rolodexes, calendars, tape recorders, libraries, diaries, albums, televisions, maps or newspapers,” he wrote.

Chief Justice Roberts acknowledged that the decision would make law enforcement more difficult.

“Cellphones have become important tools in facilitating coordination and communication among members of criminal enterprises, and can provide valuable incriminating information about dangerous criminals,” he wrote. “Privacy comes at a cost.”

But other technologies, he said, can make it easier for the police to obtain warrants. Using email and iPads, the chief justice wrote, officers can sometimes have a warrant in hand in 15 minutes.

Ellen Canale, a spokeswoman for the Justice Department, said the department would work with its law enforcement agencies to ensure full compliance with the decision.

The Supreme Court is occasionally criticized for its lack of technological savvy, but Chief Justice Roberts, 59, seemed fully familiar with what smartphones can do. “The average smartphone user has installed 33 apps,” he wrote, “which together can form a revealing montage of the user’s life.”

There are mobile applications, he said, for “Democratic Party news and Republican Party news,” for “alcohol, drug and gambling addictions,” for “sharing prayer requests” and for “tracking pregnancy symptoms.” Records from those applications, he added, “may be accessible on the phone indefinitely.” And yet more information, he said, may be available through cloud computing.

“An Internet search and browsing history,” he wrote, “can be found on an Internet-enabled phone and could reveal an individual’s private interests or concerns — perhaps a search for certain symptoms of disease, coupled with frequent visits to WebMD. Data on a cellphone can also reveal where a person has been. Historic location information is a standard feature on many smartphones and can reconstruct someone’s specific movements down to the minute, not only around town but also within a particular building.”

The first case, Riley v. California, No. 13-132, arose from the arrest of David L. Riley, who was pulled over in San Diego in 2009 for having an expired auto registration. The police found loaded guns in his car and, on inspecting his smartphone, entries they associated with a street gang.

A more comprehensive search of the phone led to information that linked Mr. Riley to a shooting. He was later convicted of attempted murder and sentenced to 15 years to life in prison. A California appeals court said neither search had required a warrant.

The second case, United States v. Wurie, No. 13-212, involved a search of the call log of the flip phone of Brima Wurie, who was arrested in 2007 in Boston and charged with gun and drug crimes. Last year, the federal appeals court in Boston threw out the evidence found on Mr. Wurie’s phone.

News organizations, including The New York Times, filed a brief supporting Mr. Riley and Mr. Wurie in which they argued that cellphone searches can compromise news gathering.

The Justice Department, in its Supreme Court briefs, said cellphones were not materially different from wallets, purses and address books. Chief Justice Roberts disagreed.

“That is like saying a ride on horseback is materially indistinguishable from a flight to the moon,” he wrote.

Jeffrey L. Fisher, a lawyer for Mr. Riley, said the decision was a landmark. “The decision brings the Fourth Amendment into the 21st century,” he said. “The core of the decision is that digital information is different. It triggers privacy concerns far more profound than ordinary physical objects.”

The Supreme Court’s decisions can be technical. This one was straightforward. What must the police do when they want to search a cellphone in connection with an arrest?

“Get a warrant,” Chief Justice Roberts wrote.

Correction:

Because of an editing error, an earlier version of this article rendered incorrectly a quote from Chief Justice John G. Roberts Jr. He said, “That is like saying a ride on horseback is materially indistinguishable from a flight to the moon.” He did not say, “That is like saying a ride on horseback is not materially indistinguishable from a flight to the moon.”

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Justices, 9-0, Rule Cellphone Search Needs a Warrant. Order Reprints | Today’s Paper | Subscribe