[Representational Image] iOS 9.3 jailbreak status: New Apple iOS 9.3 beta v5.0 can be jailbroken, says hacker Picture: A man inspects the Apple iPhone 6 Plus at an electronics store in Mumbai, India, July 23, 2015.Reuters

The United States Department of Justice (DoJ) cannot force Apple Inc. to break the passcode security of an iPhone owned by a defendant in a drug case, Magistrate Judge James Orenstein in Brooklyn reportedly said Monday. 

The DoJ sought Apple's assistance in an ongoing investigation against defendant Jun Feng, who in October pleaded guilty in a methamphetamine conspiracy. They want the tech company to break into Jun's iPhone 5s, seized by U.S. Drug Enforcement Administration in 2014.

Orenstein questioned if the All Writs Act is applicable in this case, USA Today reports. The question "is not whether the government should be able to force Apple to help it unlock a specific device; it is instead whether the All Writs Act resolves that issue and many others like it to come," he said, adding that it did not.

The Magistrate also said that Apple was exempted from such requests under a 1994 law — Communications Assistance for Law Enforcement Act, according to Reuters.

"The government posits a reading of the latter phrase so expansive – and in particular, in such tension with the doctrine of separation of powers – as to cast doubt on the AWA's constitutionality if adopted," Reuters quoted Orenstein as saying.

"The implications of the government's position are so far-reaching – both in terms of what it would allow today and what it implies about Congressional intent in 1789 – as to produce impermissibly absurd results," he added.

The U.S. government was "disappointed" with the ruling and plans to approach a Brooklyn district court judge, USA Today quoted Justice department spokesperson Emily Pierce as saying in a statement.

"Apple expressly agreed to assist the government in accessing the data on this iPhone — as it had many times before in similar circumstances — and only changed course when the government's application for assistance was made public by the court," the statement read.

The ruling came even as the Federal Bureau of Investigation (FBI) is seeking details of an iPhone that belonged to the attacker of December 2015 attack in California's San Bernardino, in which at least 14 people were killed. A California judge asked Apple to unlock the iPhone in an order, which the tech company has opposed. 

Although California Magistrate Judge Sheri Pym, hearing the US government's plea demanding that Apple unlock San Bernardino shooter Syed Rizwan Farook's iPhone, will not be bound by Orenstein's ruling, it is likely to influence the San Bernardino case.