Media playback is unsupported on your device Media caption Apple's CEO Tim Cook: ''We have a responsibility to help you protect your data''

The FBI says it may have found a way to unlock the San Bernardino attacker's iPhone without Apple's assistance.

A court hearing with Apple scheduled for Tuesday has been postponed at the request of the US Justice Department (DOJ), Apple has confirmed.

The DOJ had ordered Apple to help unlock the phone used by San Bernardino gunman Rizwan Farook.

But Apple has continued to fight the order, saying it would set a "dangerous precedent".

Rizwan Farook and his wife killed 14 people in San Bernardino, California, last December before police fatally shot them.

UN human rights chief backs Apple

Apple boss hits back at FBI conduct

McAfee offers to unlock iPhone for FBI

Analysis: Dave Lee, BBC North America technology reporter

Ever since this issue arose, security experts have been saying "surely the FBI can do this themselves?" Well, maybe now they can.

An "outside party" - you'd assume a security company, but we don't know for sure - has approached the FBI and said it could unlock the phone.

If they can do it, the court case is irrelevant. The FBI gets what they need. But if it doesn't work, we'll find ourselves back here to resume the trial.

Apple's legal team told reporters it wasn't treating it as a legal victory. The issue still looms large over the company. If the FBI has found a way, who's to say it'll always work? Apple will, as any software maker would, frantically try to fix the flaw. After all - if the FBI can do it, so can any other hacker privy to the same information.

If this method works, then what? With each new iteration of iOS, Apple could find itself back in court.

The technology industry, led by Apple, has called for the matter to be debated in Congress. This case may be on the brink of going away, but the debate is just starting.

Read more from Dave

Prosecutors said "an outside party" had demonstrated a possible way of unlocking the iPhone without the need to seek Apple's help.

"Testing is required to determine whether it is a viable method that will not compromise data on Farook's iPhone," a court filing said.

"If the method is viable, it should eliminate the need for the assistance from Apple."

DOJ spokeswoman Melanie Newman said in a statement that the government was "cautiously optimistic" that the possible method to unlock the phone would work.

The government said it would update the court on 5 April.

Image copyright AP Image caption Rizwan Farook, right, and his wife Tashfeen Malik, killed 14 people at an office party on 2 December

Attorneys for Apple told reporters that the firm had no idea what method the FBI was exploring to try to unlock the phone.

They said they hoped that the government would share with Apple any vulnerabilities of the iPhone that might come to light.

The FBI says Farook and his wife Tashfeen Malik were inspired by so-called Islamic State and that the encrypted iPhone may contain crucial evidence.

It wants to access the data but the device can only be unlocked by entering the correct passcode.

Guessing the code incorrectly too many times could permanently delete all data on the phone, so the FBI had asked Apple to develop a new version of its operating system that circumvents some of its security features.

Last month the DOJ obtained a court order directing Apple to create that software,

But Apple has fought back, stating that creating a compromised version of the operating system would have security implications for millions of iPhone users and would set a precedent.

The company has received support from other tech giants including, Google, Microsoft, and Facebook, as it resisted a court order to unlock the iPhone.