Digital privacy proponents just got a helping hand from the highest court in the land on Friday as the U.S. Supreme Court ruled in a 5-4 decision that law enforcement officers must have a warrant to gather cellphone location data to use as evidence in court trials. The ruling overturned the decision made by the Sixth Circuit Court of Appeals that struck down the Fourth Amendment protection.

Carpenter v. United States (2018) is now the first case to set jurisprudence on phone location data, regarding how law enforcement agencies can use technology as they build cases against criminals. The subject of the case goes back to a robbery committed in Detroit, Michigan in 2011, after which police gathered months of phone location data from Timothy Carpenter’s phone provider. Law enforcement gathered data from the previous 127, totaling 12,898 different locations to build a case against Carpenter.

The legal concern here was that police gathered this evidence without a filing a warrant.

The Sixth Circuit Court of Appeals found that cellphone location data is not protected under the Fourth Amendment, forbidding unreasonable search and seizure. Therefore a warrant was not required.

Though, Chief Justice John Roberts found that the government’s searches of Carpenter’s phone records were considered a Fourth Amendment search, which required a legal warrant.

In his majority opinion, Roberts wrote, “The Government’s position 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.”

Roberts said that Fourth Amendment protections and the privacy expectation therein do not allow law enforcement to gain an “all-encompassing record” of one’s whereabouts. Moreover, he added that historical GPS data presents an “even greater privacy risk” than real-time GPS monitoring.

Caprenter’s attorney, Nathan Freed Wessler from the ACLU, said the ruling is a “groundbreaking victory” for digital-age privacy rights. “The Supreme Court has given privacy law an update that it has badly needed for many years, finally bringing it in line with the realities of modern life. The government can no longer claim that the mere act of using technology eliminates the Fourth Amendment’s protections,” he said.

Before the case was heard, Apple, Google, Facebook, and other tech giants filed an amicus brief, urging the justices to make it harder for law enforcement officials to obtain individuals’ data without a warrant, according to CNET.

While the decision sets a ruling for historical GPS data, the Supreme Court said it does not apply to security cameras, business records or real-time location tracking.