The U.S. Justice Department on Monday sought to overturn a ruling which protects Apple from unlocking an iPhone in a New York drug case.

A magistrate judge in Brooklyn last week ruled that the Justice Department could not compel the tech giant to unlock the phone. The government on Monday resubmitted its arguments to a higher judge overseeing the matter.

RELATED: Supreme Court denies Apple e-books price-fixing appeal

Prosecutors are relying on the same law in its fight against Apple in a California court, where a judge ordered Apple to unlock an encrypted phone belonging to one of the San Bernardino shooters. The clash has intensified a long-running debate over how much law enforcement and intelligence officials should be able to monitor digital communications.

In its filing on Monday, the Justice Department cited the California decision as evidence that the All Writs Act has been used to compel Apple to unlock the phones. Additionally, the government argued that the phone at issue in New York runs an older operating system which Apple has agreed to crack several times in previous cases.

U.S. Magistrate Judge James Orenstein in Brooklyn ruled last week that he did not have the legal authority under the All Writs Act to order Apple to hand over the data from the phone.

In a statement on Monday, Apple said it agreed with Orenstein's ruling, which said the Justice Department's request would "thoroughly undermine fundamental principles of the Constitution."

Apple Chief Executive Tim Cook has said he is willing to take the California case to the Supreme Court. Apple has said it would create a "back door" to phones that could be abused by criminals and governments.

The phone in the New York case belonged to Jun Feng, who has since pleaded guilty to participation in a methamphetamine distribution conspiracy. The Justice Department sought to unlock Feng's phone to find other conspirators.

RELATED: More criminals are using iPhones because of encryption, police say

Unlike the phone used by Rizwan Farook in San Bernardino, Feng's phone had an iOS 7 mobile operating system, which is not protected under the same encryption technology.

"Apple has the technological capability to bypass the passcode feature and access the contents of the phone that were unencrypted," the Justice Department said in its Monday filing.

The Justice Department has asked District Court Judge Margot Brodie to hear the case.