The so-called "Carpenter" case had centered on the eponymous Timothy Carpenter, a criminal who was caught thanks to cell phone records in 2011. Law enforcement had obtained his location data from a phone provider without a search warrant, arguing the provider already had his data and Carpenter had no "reasonable expectation of privacy."
But the court found the government's warrantless access to cell-site records over a period of time "contravenes that expectation" of privacy, said Roberts.
"The fact that such information is gathered by a third party does not make it any less deserving of Fourth Amendment protection," said Chief Justice John Roberts, who delivered the decision.
"Because location information is continually logged for all of the 400 million devices in the United States -- not just those belonging to persons who might happen to come under investigation -- this newfound tracking capacity runs against everyone," said Roberts.
"Only the few without cell phones could escape this tireless and absolute surveillance," he added.
The court stressed that the decision does not consider real-time tracking, or so-called "tower dumps," which police use to obtain information on all of the devices connected to a cell tower at during a particular period of time.
Roberts added that the government's argument "fails to contend with the seismic shifts in digital technology that made possible the tracking of not only Carpenter's location but also everyone else's, not for a short period but for years and years."
Police may, however, still obtain this data without a warrant in exigent circumstances, such as if there is an immediate threat or danger to life.
Nate Wessler, an attorney with the ACLU who fought the case, said the decision was a "groundbreaking victory for Americans' privacy rights in the digital age."
According to the ACLU, every time a phone makes or receives a call or text message, "the phone company logs and retains a record of the phone's location based on the cell tower and cellular antenna the phone was connected to."
"The volume and precision of that location data has increased over time, and today, cellphone location data can paint a detailed picture of where we go over the course of days, weeks, and months," said the civil liberties group in a blog post.
But the case ran on, with lawyers contesting the police violated the Fourth Amendment, which is supposed to protect against unwarranted searches and seizures.
Legal followers of the case have long seen the decision as a ruling on exactly what "reasonable expectation of privacy" means.
This "third-party doctrine" was established because there is no constitutional protections for data voluntarily shared with businesses, like phone records. Although an established legal principle, it's fallen to shaky ground. Justice Sonia Sotomayor wrote in 2011 that as phones become more ubiquitous, the third-party doctrine becomes "ill suited to the digital age."
Tech companies, including Apple, Facebook, and Google, filed briefs in the case, arguing users should be protected because, today more than ever, data stored on phones can reveal a wealth of sensitive information.
"That users rely on technology companies to process their data for limited purposes does not mean that they expect their intimate data to be monitored by the government without a warrant," said the brief.
Privacy and civil liberties advocates praised the court's ruling.
ACLU deputy legal director Cecillia Wang tweeted that the decision is a "civil liberties victory." Sen. Ron Wyden (D-OR) called the ruling "a big win for privacy."
Alex Abdo, senior staff attorney at the Knight Institute, said the ruling "places important limits on the government's surveillance power."