A Maryland appeals court has issued what civil liberties groups called the first appellate opinion in the country stating that police must obtain a warrant before using covert cellphone-tracking devices, rebuking Baltimore police and prosecutors for “misleading” judges for years about secret and “unconstitutionally intrusive conduct.”

Maryland’s intermediate Court of Special Appeals issued the strongly worded opinion late Wednesday following a March 3 order that Baltimore police could not use evidence collected by a cell-site simulator device against defendant Kerron Andrews, charged with attempted murder in 2014.

Such devices, known by commercial names such as StingRay, Triggerfish and Hailstorm, imitate a cellular tower to have phones in an area connect to it. That enables real-time tracking of phones. The briefcase-size devices can be transported in vehicles and collect data from any bystanders’ phones in range.

“We conclude that people have a reasonable expectation that their cell phones will not be used as real-time tracking devices by law enforcement, and . . . that people have an objectively reasonable expectation of privacy in real-time cell phone location information,” Judge Andrea M. Leahy wrote for a three-member panel that included judges Dan Friedman and Raymond G. Thieme Jr.

The court admonished Baltimore police and prosecutors for using the technology and signing an agreement with the FBI and device manufacturers to never disclose its existence to the public, courts or defense counsel. Other law enforcement agencies across the country have entered into the same secrecy deals, according to information gleaned through litigation or public-records requests.

[Secrecy around police surveillance equipment proves a case’s undoing]

In the Andrews case, police hid their use of a Harris Corp. Hailstorm device by obtaining approval from a judge for a “pen register/trap & trace” order, a technique used to collect all numbers dialed to or from a particular phone line, the opinion stated. However, such orders traditionally have gone to phone companies, do not obtain a target phone’s real-time location and require presenting a lower standard of proof to a judge than would a search-warrant request.

The FBI nondisclosure agreement “obstructs” the court “from exercising its fundamental duties under the Constitution,” Leahy wrote, to protect Americans against illegal searches under the 4th Amendment.

“We perceive the State’s actions in this case to protect the Hailstorm technology, driven by a nondisclosure agreement to which it bound itself, as . . . inimical to the constitutional principles we revere,” the court wrote.

In a statement, David Nitkin, a spokesman for Maryland Attorney General Brian E. Frosh (D), said, “We are reviewing the written ruling and evaluating next steps.”

The Baltimore Police Department did not respond to requests for comment.

The ruling by Maryland’s second-highest court covers scores of pending cases throughout the state, although the court left open whether its reasoning would apply retroactively and allow post-conviction appeals in closed cases.

Baltimore police testified in the case to using the technology 4,300 times since 2007. State and Anne Arundel and Baltimore county police have also confirmed use of the technology.

Assistant Maryland Public Defender Daniel Kobrin, who argued the appeal, called the decision a “landmark ruling for how our privacy laws can keep up with advancing technology” in the digital age, when smartphones are ubiquitous.

Nathan Freed Wessler, staff attorney with the American Civil Liberties Union, which filed a friend-of-the-court brief with the Electronic Frontier Foundation in the case, said he expected courts across the country to look to the Maryland opinion, which he said “shows why it is so important for these kinds of privacy invasions to be subjected to judicial review.”

[D.C. appeals court weighs challenge to StingRay use by D.C. police ]

Police in Charlotte, Milwaukee and Tacoma, Wash., have reported using cell-site simulators in hundreds of cases in recent years, including under pen-register orders. New York City police, the Florida Department of Law Enforcement and the Sacramento sheriff’s department also disclosed using devices thousands of times.

State legislatures in Utah, Minnesota, Virginia, Washington and Wisconsin have passed laws requiring police to obtain warrants for using the devices, a policy the U.S. Justice Department also announced in September.

The Wisconsin State Supreme Court in July 2014 allowed the warrantless use of a StingRay device in a 2009 case, ruling that a court pen-register order explicitly authorized police to identify the location of a phone. The ruling in the 2009 case came after the state legislature in 2014 passed a warrant requirement that covered future cases.

[Justice Department: Agencies need warrants to use cellphone trackers]