The U.S. Supreme Court on Monday ruled that geofence warrants — a law enforcement technique that compels technology companies to search their databases for the location history of every cellphone user within a defined area — violate the Fourth Amendment’s protection against unreasonable searches.

The 6-3 decision, written by Justice Elena Kagan, curtailed the use of a tool that police departments across the country had adopted as a routine method for identifying suspects near crime scenes. Geofencing entails drawing a virtual fence around a geographic area where a crime occurred and then obtaining a warrant requiring a tech company to disclose which of its users were inside that area during a specific period.

The case arose from a 2019 bank robbery in suburban Richmond, Virginia, where a man stole $195,000 from a bank. After two months, the investigation had gone cold. Detectives then served a geofence warrant on Google, requesting the location information of cellphone users in and around the bank for the hour before and after the robbery.

Google initially identified 19 individuals whose location data placed them in or near the bank during that time frame. After further analysis, the company provided police with the names of just three people whose location data showed they were actually at the bank. When officers visited the home of one of them — Okello Chatrie — they found a pistol matching a firearm seen on security camera footage of the robbery and nearly $100,000 in cash. Chatrie later confessed and was convicted.

In their challenge to the warrant, Chatrie’s attorneys argued that geofence searches violate the Fourth Amendment because they allow the government “to search first and develop suspicions later.” The warrant directed Google to search millions of users’ location histories, meaning that millions of people who had done nothing suspicious were subjected to a search, they said.

The government maintained in its legal filings that because individuals can choose not to share their location data with companies like Google, that data is not constitutionally protected. The Supreme Court rejected that argument, siding with Chatrie and with critics, as The Guardian reported, who viewed geofence warrants as an unconstitutional dragnet.

Justice Kagan’s majority opinion held that the technique violates the Fourth Amendment. The opinion, as reported by NPR, establishes that geofence warrants must comply with constitutional privacy protections for the location data generated by everyday cellphone use.

Geofence warrants had become increasingly common in recent years, with law enforcement agencies using them to narrow suspect pools. Critics, the sources reported, warned that the practice amounted to a general warrant because it searches millions of people before identifying any suspect.

The decision resolves a legal question that had divided federal appeals courts. The Court of Appeals for the Fourth Circuit had upheld the warrant in Chatrie’s case, but its judges were divided on fundamental legal questions, including whether examining geofence data qualifies as a search under the Fourth Amendment.

The ruling requires geofence warrants to comply with constitutional privacy protections, meaning law enforcement must meet a higher standard before compelling companies to disclose mass location data, according to the court’s decision.