Law enforcement must generally obtain a warrant before searching the contents of a cellphone that belongs to a person under arrest, the U.S. Supreme Court said on Wednesday in a major ruling on digital privacy.

The court said warrantless searches of mobile devices are permitted under limited circumstances under the Fourth Amendment. Chief Justice John Roberts Jr. delivered the unanimous opinion for the court.