A judge has postponed a court hearing about the FBI's demand for Apple to unlock the phone of one of the San Bernardino terrorists after the agency said they may have found a way to unlock on their own.

In a filing late Monday, federal prosecutors asked to delay a much-anticipated court hearing set for Tuesday over the FBI's demand for Apple to help unlock Syed Rizwan Farook's encrypted phone.

An "an outside party" came forward over the weekend and showed the FBI a possible method for unlocking the phone, according to the filing.

Authorities need time to determine "whether it is a viable method that will not compromise data" on the phone.

If viable, "it should eliminate the need for the assistance from Apple," according to the filing.

In a statement, U.S. Justice Department spokeswoman Melanie Newman said the government was "cautiously optimistic" that the possible method will work.

Magistrate Judge Sheri Pym could rule on the government's request to delay Tuesday's hearing at any time.

For more than a month, the government and Apple have waged a very public debate over whether breaking into one phone would jeopardize the security of all encrypted devices.

Syed Farook, the suspect

Prosecutors have argued that the phone used by Farook probably contains evidence of the Dec. 2 attack in which the county food inspector and his wife, Tashfeen Malik, slaughtered 14 at a holiday luncheon attended by many of his work colleagues. The two were killed in a police shootout hours later.

The FBI has said the couple was inspired by Isis. Investigators still are trying to piece together what happened and find out if there were collaborators.

The couple destroyed other phones they left behind and the FBI has been unable to circumvent the passcode needed to unlock the iPhone, which is owned by San Bernardino County and was given to Farook for his job.

Last month, Pym ordered Apple to create software that would disable security features on the phone, including one that erases all the information if a passcode is incorrectly entered more than 10 times. That would allow the FBI to electronically run possible combinations to open the phone without losing data.

In pictures: San Bernardino shooting Show all 15 1 /15 In pictures: San Bernardino shooting In pictures: San Bernardino shooting A couple embraces following a shooting that killed multiple people at a social services facility, in San Bernardino In pictures: San Bernardino shooting A victim is wheeled away on a stretcher following a shooting that killed multiple people at a social services facility, in San Bernardino AP In pictures: San Bernardino shooting Rescue crews tend to the injured in the intersection outside the Inland Regional Center in San Bernardino Reuters In pictures: San Bernardino shooting A survivor (2nd L) of the mass shooting at the Inland Regional Center meets her family after police questioning in San Bernardino Rex In pictures: San Bernardino shooting An armed police officer protects a busload of people who were inside the Inland Regional Center where gunmen shot and killed 14 people and injured another 14, to be escorted to meet relatives at the Rudy Hernandez Community Center in San Bernardino Reuters In pictures: San Bernardino shooting People wait at a community center for a family member who was near a shooting that killed multiple people at a social services center, in San Bernardino, California AP In pictures: San Bernardino shooting In this image taken from video, armored vehicles surround an SUV following a shootout in San Bernardino AP In pictures: San Bernardino shooting Law enforcement officers search for the suspects of a mass shooting in San Bernardino Getty Images In pictures: San Bernardino shooting Law enforcement officers search for the suspects of a mass shooting in San Bernardino Getty Images In pictures: San Bernardino shooting The Inland Regional Center complex is pictured in an aerial photo following a shooting incident in San Bernardino Reuters In pictures: San Bernardino shooting Authorities prepare to search an area near a church, following a shooting that killed multiple people at a social services center for the disabled in San Bernardino AP In pictures: San Bernardino shooting Evacuees from the scene of a shooting at the Inland Regional Center hug each other as they wait inside the Rudy C Hernandez Community Center in San Bernardino EPA In pictures: San Bernardino shooting Omar Riopedre embraces his wife Diana, who was in the Inland Regional Center when the mass shootings took place, as they leave the Rudy C. Hernandez Community Center in the San Bernardino In pictures: San Bernardino shooting A Sheriff's Deputy runs after reports that suspects in the shooting at the Inland Regional Center were sighted in San Bernardino EPA In pictures: San Bernardino shooting Law enforcement officers search for suspects in a neighborhood after a shooting at the Inland Regional Center in San Bernardino EPA

Apple said the government was seeking "dangerous power" that exceeds the authority of the All Writs Act of 1789 it cited and violates the company's constitutional rights, harms the Apple brand and threatens the trust of its customers to protect their privacy. The 18th-century law has been used on other cases to require third parties to help law enforcement in investigations.

The company said the order is unreasonably burdensome. Once created, it would be asked to repeatedly design such software for use by authorities at home and abroad, and the technology could fall into the hands of hackers.

The couple destroyed several other phones in their house (pictured) before the attack (AFP)

The government has countered that Apple could create the software for one phone, retain it during the process to protect itself, then destroy it. Apple has said that creating software is a form of speech and being forced to do so violates its First Amendment rights.

Apple says it was being asked to create a method to access the phone's data that does not exist.

Three weeks ago, the judge sided with Apple, saying prosecutors were stretching an old law "to produce impermissibly absurd results."

The government is appealing that order.