Updated 11:02 a.m. ETIn a major win for privacy rights, the U.S. Supreme Court ruled Friday that police must obtain a search warrant in order to get access to cellphone location information.Chief Justice John Roberts wrote the 5-4 decision, joining the court's four liberals. The majority declared that the Fourth Amendment guarantees an expectation of privacy and that allowing police to obtain moment-by-moment tracking of an individual's cellphone location is a kind of surveillance that the framers of the Constitution did not want to occur without a search warrant.The chief justice said that this sort of tracking information is akin to wearing an electronic ankle-bracelet monitoring device and that the citizens of the country are protected from that kind of monitoring unless police can show a judge that there is probable cause of a crime that justifies it.He stressed, however, that this is a narrowly focused opinion that leaves intact other precedents when it comes to dealing with financial information, banking and office records.Roberts noted that the decision also allows for warrantless cell-tower location information searches in emergencies and for national security purposes.The four dissenters were led by Justice Anthony Kennedy, who was joined by the court's three most conservative members, Justices Clarence Thomas, Samuel Alito and Neil Gorsuch. In a rare move, each filed a separate dissent.The backgroundThe case arose out of a series of armed robberies in 2010 and 2011 — robberies, ironically, aimed at stealing hundreds of new cellphones and selling them for tens of thousands of dollars.When police apprehended some members of the ring, the smaller fish implicated the leader of the ring, Timothy Carpenter. Police got a court order to get access to 127 days of cellphone tracking records for Carpenter and other members of the gang.Lo and behold, Carpenter's general location information matched the robbery locations, and that information was used to help convict him. Carpenter appealed his conviction to the Supreme Court, contending that the Constitution required that police first obtain a warrant before getting this location information from a service provider.Obtaining a warrant would have required the police to show a judge that they had probable cause to believe the phone records contained evidence of a crime. What the police did instead was obtain a court order under the federal Stored Communications Act, which is easier.New technology clashes with decades-old doctrineThis was seven years ago, and several smartphone generations ago, too.The information used at Carpenter's trial was not exactly precise. It did not record where he was when he texted or where he was when his phone was not in use.But when he made or received calls, the cellphone towers nearby recorded his general location with an accuracy range of about a half-mile to 2 miles. And those calls matched up rather nicely with the vicinity of the robberies.At oral arguments in November, the justices seemed torn about whether to break with the so-called third party doctrine. Adopted decades ago, that doctrine says that there is no reasonable expectation of privacy when an individual shares information with a third party — for example, the phone company, which knows what telephone numbers the individual calls and receives. Therefore, police do not have to get a search warrant to gain access to those numbers.But in recent years, the justices have expressed discomfort with that rule of law as applied to the modern digital age, when cellphones carried in a person's pocket can track locations day and night, and when email and text addresses tell a huge amount about an individual's contacts and lifestyle. Copyright 2018 NPR. To see more, visit https://www.npr.org/.