BALTIMORE (AP) - The Baltimore Police Department has used secretive cellphone surveillance equipment 4,300 times and believes it is under orders by the U.S. government to withhold evidence from criminal trials and ignore subpoenas in cases where the device is used, a police detective testified Wednesday.

The unusual testimony in a criminal case marked a rare instance when details have been revealed about the surveillance devices, which the Obama administration has aggressively tried to keep secret. Citing security reasons, the government has intervened in routine state public-records cases and criminal trials, and has advised police not to disclose details.

On Wednesday, Baltimore police Det. Emmanuel Cabreja said the department has deployed the device, called Hailstorm, and similar technology about 4,300 times since 2007. That is believed to be higher than other known uses of similar surveillance equipment by state and local police. Hailstorm is an upgraded version of the Stingray surveillance device.

Meanwhile, Cabreja said under questioning from defense attorneys that he did not comply with a subpoena to bring the device to court because of a nondisclosure agreement between the Baltimore police and the Federal Bureau of Investigation.

"Does it instruct you to withhold evidence from the state's attorney and the circuit court of Baltimore city, even if upon order to produce?" asked defense attorney Joshua Insley.

"Yes," Cabreja replied, saying he spoke with the FBI last week about the case.

The Baltimore case surrounds a carjacking and robbery. Nicholas West and his co-defendant, a juvenile, pleaded guilty Wednesday.

Yet the case, like a handful of others in the city, has raised questions among defense attorneys and even a circuit court judge over the use of the cellphone-tracking equipment.

The Hailstorm, made by Florida-based Harris Corp., can sweep up cellphone subscriber-identity data by tricking phones into thinking it's a cell tower. That data is then transmitted to the police, allowing them to locate a phone without the user even making a call or sending a text message.

"This is a very expensive and very invasive technology developed for military use, now used on the streets of America," said Nathan Freed Wessler, a staff attorney with the American Civil Liberties Union, which has fought for the release of these types of records.

"The public has a right to know how taxpayer dollars are being spent, and if our constitutional rights are being respected," he said.

The FBI declined to immediately answer questions about the case late Wednesday.

Police across the country have largely been kept silent on how they use the devices. Because documents about Stingrays and Hailstorms are regularly censored in public records requests by citizens and journalists, it's not entirely clear what information the devices could capture - such as the contents of phone conversations and text messages, what they routinely capture based on how they're configured, or how often they might be used.

Cabreja on Wednesday said Hailstorm can identify phones from a 360-degree antenna from about a city block away in distance. He said no content, such as text messages or phone conversations, is captured in the process.

Some judges have pushed back against state and local government agencies in criminal trials and freedom-of-information requests involving the surveillance devices.

In Baltimore, Circuit Judge Barry Williams presided over an earlier trial in which the police apparently used a surveillance device to collect evidence on a robbery suspect. At a November 2014 hearing, Williams lost his patience with a state prosecutor after a police technician wouldn't answer a defense attorney's questions about the device - citing the same FBI nondisclosure agreement.

"You don't have a nondisclosure agreement with the court," Williams told police Det. John Haley, part of the department's advanced technical team. "Answer the question."

The prosecutors instead withdrew the evidence, avoiding a contempt citation and questions about the equipment's use.

Two months earlier, Williams threw out evidence in yet another criminal case involving cellphone tracking after a police sergeant said there were unspecified "homeland security" issues when asked why the suspect was stopped.

"If it goes into homeland security issues, then the phone doesn't come in," Williams said, telling the prosecutor, "You can't just stop someone and not give me a reason."

This week, officials in upstate New York released documents about their Stingray use after a state judge ordered them to do so.

Records released by the New York Civil Liberties Union showed a county sheriff in Buffalo, New York, used the device 47 times since 2010 - apparently only once obtaining a court order to do so. The device has helped other agencies, records show, including the U.S. Marshals Service in locating a fugitive.

Documents show the county paid more than $264,000 for the surveillance equipment. The NYCLU had sued the county for the documents.

Last May, Erie County Sheriff Tim Howard told county lawmakers that "specific use of the device should be left to the monitoring of the courts, and not to the legislature or to the media."

___

Associated Press writer Eric Tucker in Washington contributed to this report.

___

Follow on Twitter: Jack Gillum at https://twitter.com/jackgillum and Juliet Linderman at https://twitter.com/julietlinderman