The FBI has a secret device to locate criminal suspects, but it would apparently rather let suspects go free than reveal in court any details of the high tech tracker.

The device, called a "Stingray," tricks cell phones into revealing their locations. A judge's court order this week threatens to reveal closely guarded details about how police use Stingrays.

Judge Patrick H. NeMoyer in Buffalo, New York, described a 2012 deal between the FBI and the Erie County Sheriff's Office in his court order Tuesday: The FBI instructed the police to drop criminal charges instead of revealing "any information concerning the cell site simulator or its use."

Erie police had long tried to keep that contract secret, but the judge rejected that idea and ordered that details of the Stingrays be made public.

"If that is not an instruction that affects the public, nothing is," NeMoyer wrote.

Erie police had used Stingrays to track down several criminal suspects, a suicidal person and four missing people, including an 87-year-old with dementia, according to the judge's order.

The Erie County Sheriff's Office declined to comment to CNNMoney on Wednesday. Police spokesman Scott Zylka said they're now working with the FBI to appeal the judge's decision and keep the FBI agreement secret.

The FBI did not provide immediate comment.

The American Civil Liberties Union is demanding details about Stingray use under public records laws.

What are Stingrays?

Few people know Stingrays even exist -- or that federal agents and police across the country are increasingly using them to arrest people. It's a small device that mimics a cell phone tower, duping nearby cell phones into connecting to it rather than a real phone company tower.

There's a growing privacy concern because while police use the Stingrays to track down an individual, they can potentially grab text messages and phone call data on thousands of innocent people.

In November, we learned that federal agents regularly fly planes nationwide that spy on Americans' phone calls. We also know police in at least 20 states use Stingrays, according to public records obtained by the ACLU.

But everything else is a mystery because police agencies have non-disclosure agreements with the maker of Stingrays: the Harris Corporation based in Melbourne, Florida. They also have similar hush-hush contracts with the FBI.

There have been several examples of prosecutors dropping charges to keep quiet about Stingrays. Late last year, Tallahassee police gave a sweet plea deal to a pot dealer who robbed someone with a BB gun. A felony charge with a four-year prison sentence became a misdemeanor with six-months' probation because his defense attorney discovered police used a Stingray to locate him.

Hanni Fakhoury, an attorney with the pro-privacy Electronic Frontier Foundation, said Tuesday's court order was the first time that revealed a nationwide police tactic to maintain secrecy at all costs.

"We've long suspected that's the policy, but now we know," he said. "It's crazy on a billion legal levels."

The lead ACLU attorney on this case, Mariko Hirose, described Stingrays as military grade equipment that has no place being used on unsuspecting American citizens. She also said that the FBI's tactic to stay quiet about Stingrays makes little sense. Erie County spent more than $350,000 to buy two Stingray devices and related training and equipment.

"Why are municipalities spending so much money when they might have to drop the charges in the name of secrecy?" she asked.