A New York district court judge has ruled in Apple's favour in its battle against the FBI in a case eerily similar to the one on the San Bernardino, California, terror incident. Judge James Orenstein held that a 227-year-old law does not justify the US government's request to legally force Apple to unlock an iPhone deemed to have evidence.

The ruling came in a narcotics case over a separate yet similar demand in California pertaining to the iPhone. Judge Orenstein's 50-page ruling dwells on some of the government's interpretation of the All Writs Act. He said the case reflected an intention to bypass Congress and persuade courts to expand law enforcement powers.

He said: "While the government's hesitation to reveal what its intelligence agencies can and cannot do is entirely understandable, and may well be an appropriate exercise of discretion to promote national security, that does not mean that the choice must be cost-free for the government in this litigation. Thus, even taking the government at the most recent of its words, there is no showing that Apple's assistance will accomplish something that the government itself deems to be a necessity."

The ruling is widely seen as providing Apple with more arsenal in its fight against the FBI in the San Bernardino case. The California court has already issued an order in favour of the US government. But Apple is defying and has filed an appeal, saying it cannot yield to the government's increasing pressure to create a "backdoor" for surveillance.

The New York drugs case began in September 2015 and involves an older model iPhone which, according to Apple, would have been relatively simple to access. The San Bernardino case involves a newer iPhone model with more advanced security and privacy features.

Judge Orenstein pointed out that Apple had so far complied with 70 other orders and assisted the government in such cases in the past. It was even willing to comply with the government's request in this case and went so far as to offer to help phrase the FBI's court application in an appropriate way.

The New York ruling came as Apple's general counsel, Bruce Sewell, is slated to appear before the California Judiciary Committee to present his opening arguments in the San Bernardino case.

In a related development, US Senator Mark R Warner of the Senate Intelligence community, in collaboration with Michael McCall, chairman of the Homeland Security Committee, has proposed a new National Commission on Security and Technology Challenges to provide the US government with recommendations on such technology-related cases, while striving to "maintain privacy and digital security".

"I believe that we can strike an appropriate balance that protects Americans' privacy, American security, and American competitiveness, but we won't achieve that while all sides continue to talk past each other. What we don't want is a solution that could simply drive terrorists to use software and hardware based overseas, pushing their communications even farther out of reach for American law enforcement and intelligence," said Warner.

Judge Orenstein's ruling also calls for such a debate in cases that involve US government demanding assistance from tech firms. He concluded in his ruling: "Ultimately, the question to be answered in this matter, and in others like it across the country, 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 yet to come."