The FBI asked Apple this week to help extract data from iPhones that belonged to the Saudi aviation student who investigators say fatally shot three sailors at a U.S. naval base in Florida last month. Investigators have been trying to access an iPhone 7 and an iPhone 5 that belonged to Mohammed Alshamrani, a 21-year-old 2nd Lieutenant in the Royal Saudi Air Force, but have been unsuccessful because the phones are locked and encrypted, according to a letter from the FBI's general counsel, Dana Boente.

The FBI has received a court authorization to search the phones and the devices have been sent to the bureau's lab in Quantico, Virginia, Boente said.

The investigation is considered a "high-priority national security matter," Boente said in the letter, which was reviewed by The Associated Press. Alshamrani opened fire at the Pensacola naval base on December 6, killing three sailors and injuring several others before he was shot dead by a sheriff's deputy.

Get Breaking News Delivered to Your Inbox

FBI officials have sought help from several other federal agencies while other experts and investigators have been trying to guess the passwords, but those efforts have been unsuccessful, according to the letter.

At least one of the phones was shot by a sheriff's deputy during the attack, but investigators believe they may still be able to extract data from the device, according to a person familiar with the matter. The person spoke on condition of anonymity in order to discuss an ongoing investigation.

Apple said in a statement that it has already provided investigators with all the relevant data held by the company.

"We have the greatest respect for law enforcement and have always worked cooperatively to help in their investigations," the company said. "When the FBI requested information from us relating to this case a month ago we gave them all of the data in our possession and we will continue to support them with the data we have available."

Apple, Facebook and other tech companies have periodically tussled with the FBI over the end-to-end encryption they have built into their products to protect customers' privacy. The tech industry has resisted Justice Department calls for a "backdoor" that would allow authorities to read encrypted messages, arguing that such access could also benefit spies and criminals.

Apple resisted the government's efforts to gain access to an iPhone belonging to a perpetrator of a 2015 terrorist attack in San Bernardino, California, which killed 14 people. The company went to court to block an FBI demand for Apple to disable security measures that would wipe the phone's data after 10 incorrect password guesses.

The FBI eventually withdrew its request after finding a workaround for getting into the phone. Then-FBI Director James Comey revealed in 2016 the agency had paid over $1 million for the software that allowed them to gain access to the phone.