A federal appeals court in Philadelphia ruled Tuesday that the government may need a warrant when trying to obtain phone records that show a person's location.

It was not a clear victory for privacy advocates, but it kept open a door that law enforcement had wanted to slam shut.

Kevin Bankston, a senior staff lawyer at the Electronic Frontier Foundation, said the appeals court recognized that there were circumstances that fall under the Fourth Amendment protection against unreasonable search and seizure.

"The court rejected the argument that everyone who uses a cell phone has volunteered to be tracked," Bankston said.

The decision by the U.S. Court of Appeals for the Third Circuit says that a federal magistrate judge has the option of requiring a warrant, but that "it is an option to be used sparingly" because the law allows non-warrant requests for certain types of phone records.

The government had argued that a person using a cell phone could not claim constitutional protection because the information already was being shared with a third party, the phone-service provider.

In 2008, the government asked for court permission without showing "probable cause" - the reasonable belief that a person has committed a crime - to obtain cell-phone tracking information in a Pittsburgh drug investigation.

The standard the government wanted to use for obtaining the phone records was that they were "relevant and material to an ongoing investigation." U.S. Magistrate Judge Lisa Pupo Lenihan rejected the government's request and insisted that a warrant was needed.

The appellate opinion, written by Judge Delores K. Sloviter, noted that Lenihan had an "impressive level of support" in the Western District of Pennsylvania from other magistrate judges, who routinely issue warrants.

A U.S. district judge also sided with Lenihan, and the government appealed to the Third Circuit.

A representative of the U.S. Department of Justice did not respond Tuesday evening to a request for comment.

Contact staff writer Robert Moran at 215-854-5983 or bmoran@phillynews.com.