The U.S. Justice Department said it has withdrawn a request to force Apple to reveal data from a cellphone linked to a New York drug case after someone provided federal investigators with the phone's passcode.

Federal prosecutors said in a letter to U.S. District Judge Margo Brodie that investigators were able to access the iPhone late Thursday night after using the passcode.

The government said it no longer needs Apple's assistance to unlock the iPhone and is withdrawing its request for an order requiring Apple's cooperation in the drug case.

"As we have said previously, these cases have never been about setting a court precedent; they are about law enforcement's ability and need to access evidence on devices pursuant to lawful court orders and search warrants," Justice Department spokeswoman Emily Pierce said in a statement Friday.

The Justice Department had sought to compel the Cupertino, California-based Apple to cooperate in the drug case, even though it had recently dropped a fight to compel Apple to help break into an iPhone used by a gunman in a December attack in San Bernardino that killed 14 people. In that case, a still-unidentified third-party came forward with a technique that managed to open the phone. That entity has not been named, and the Justice Department has not revealed the method used.

Representatives for Apple did not immediately respond to a request for comment Friday night.

The tech giant had been fighting the Justice Department's attempts and said in court papers last week the government's request was extraordinary because there is likely minimal evidentiary value of any data on the phone and that Congress never authorized it to pursue such requests through the 1789 All Writs Act. It also said there is no proof Apple's assistance was necessary and that the same technique the FBI was using to get information from the phone in California might work with the drug case phone.

But prosecutors had argued that the government needed Apple's assistance to access the data, which they contended was "authorized to search by warrant."

On Thursday, several groups filed arguments in Brooklyn federal court saying they feared the public will stop aiding police if Apple is allowed to refuse to give up information from the phone in the drug case. The groups said they supported the government's efforts to try to reverse a magistrate judge's ruling earlier this year for Apple.