WASHINGTON - In a landmark digital privacy case, the US Supreme Court ruled Friday that police need a warrant before obtaining cell phone location data about a suspect from telecom companies.

In a 5-4 decision, the nation’s highest court said such data is protected under the Fourth Amendment of the US Constitution, which guards against unreasonable search and seizure.

The case revolved about police acquisition of mobile phone location information about a robbery suspect, Timothy Carpenter, without a warrant.

Data from Carpenter’s cell phone — 12,898 location points over a period of 127 days — was used to show the device was in the vicinity when several robberies took place, and the suspect was convicted.

Carpenter’s attorneys and the American Civil Liberties Union (ACLU) argued that the seizure of his cell phone location data records was unconstitutional.

The Supreme Court reversed a lower court’s ruling which said police did not need a warrant to obtain such data.

Chief Justice John Roberts sided with the four liberal justices on the court in the decision. “We decline to grant the state unrestricted access to a wireless carrier’s data base of physical location information,” the court said in its opinion.

“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,” it said.

“Prior to the digital age, law enforcement might have pursued a suspect for a brief stretch,” the court said.

“(But) when the government tracks the location of a cell phone it achieves near perfect surveillance, as if it had attached an ankle monitor to the phone’s user,” it said.

“Whoever the suspect turns out to be, he has effectively been tailed every moment of every day,” it said. “Only the few without cell phones could escape this tireless and absolute surveillance.”

Nathan Freed Wessler, an attorney with the ACLU who argued the case before the court in November, called the ruling a “groundbreaking victory for Americans’ privacy rights in the digital age.”

“Today’s decision rightly recognizes the need to protect the highly sensitive location data from our cell phones,” Wessler said.

“But it also provides a path forward for safeguarding other sensitive digital information in future cases — from our emails, smart home appliances, and technology that is yet to be invented.”

Democratic Senator Ron Wyden of Oregon described the ruling as a “BIG win for privacy.”

“I’ve argued for years that the sheer volume of information about every single American that’s collected by our phones and computers requires a fundamental rethinking of the idea that giving your information to a company means the government can get it too,” Wyden said.

In its opinion, the court left open the possibility of warrantless collection of data in what it described as “urgent” situations such as “bomb threats, active shootings and child abductions.”