A federal judge in Manhattan ruled on Tuesday that drugs seized from a man charged in a narcotics case could not be used as evidence, because agents had not obtained a warrant for a covert cellphone tracking device that led them to his Washington Heights apartment, where the drugs were found.

The portable device, known as a cell-site simulator and often referred to as a Stingray, has been used widely by federal and local law enforcement officials around the country, including in New York, to solve crimes and locate missing people.

Last September, just weeks after the search in the Manhattan case, the Justice Department announced a new policy that requires federal law enforcement officials to obtain a search warrant in most cases before using a cell-site simulator.

The simulator essentially mimics a cellphone tower (or cell site), and tricks cellphones into transmitting “pings” to the device, allowing agents who have narrowed down a targeted phone’s location to determine where it is in use.