NEW YORK — The U.S. government said it no longer needs Apple’s help to get into an iPhone used by a drug dealer in New York after obtaining a passcode, ending a second courtroom battle over whether the company can be forced to help unlock its devices.

The Justice Department’s action follows its decision last month to drop efforts to force Apple to help it unlock an iPhone used by a gunman in the December terrorist attack in San Bernardino, Calif.

In the Brooklyn case, the government said in a court filing Friday that it had obtained and used a passcode by hand and gained access to the iPhone “late last night.” Because it no longer needs Apple’s assistance, it said it was withdrawing its request for a court order.

“As we have said previously, these cases have never been about setting a court precedent,” Emily Pierce, a Justice Department spokeswoman, said in a statement. “In this case, an individual provided the department with the passcode to the locked phone at issue.”

Advertise with us

The drug dealer’s iPhone was one of more than 1,000 Apple phones that cops around the U.S. have said they can’t break into, and it’s been at the epicenter of a legal fight over privacy and security that may redefine the relationship between police and the public.

Fred Sainz, an Apple spokesman, declined to comment on the government dropping its appeal.

In what could be the next brewing court fight, Apple has objected to a warrant recently unsealed in Massachusetts federal court for a phone belonging to an alleged gangster, according to a lawyer for the defendant. The order was made public this month in response to efforts by the American Civil Liberties Union of Massachusetts. The group is trying to expose a process of issuing warrants for private data that has largely gone on in secret.

In each case, Apple has rebuffed prosecutors, who then have turned to judges to make the company help them bypass encryption built into the phones.

As the cases move through the courts, technology companies have rallied to one side and law enforcement the other. Congress has struggled to craft a law to bridge the divide. A House panel this week heard from police officials who said the use of strong encryption is blocking them from fully investigating murders, drug cases and sex crimes against children.

Advertise with us

Since the Brooklyn warrant request came to light in October, the U.S. has made at least 10 other demands for Apple’s help obtaining data on locked devices, including the phone used in last year’s mass shooting in San Bernardino, according to the company. That phone had more sophisticated encryption than the one in Brooklyn. The U.S. dropped that case after hackers helped unlock that device.

The case is U.S. v. Yang, 1:14-cr-387, U.S. District Court, Eastern District of New York (Brooklyn).