WASHINGTON — Attorney General William P. Barr declared on Monday that a deadly shooting last month at a naval air station in Pensacola, Fla., was an act of terrorism, and he asked Apple in an unusually high-profile request to provide access to two phones used by the gunman.
Mr. Barr’s appeal was an escalation of an ongoing fight between the Justice Department and Apple pitting personal privacy against public safety.
“This situation perfectly illustrates why it is critical that the public be able to get access to digital evidence,” Mr. Barr said, calling on Apple and other technology companies to find a solution and complaining that Apple has provided no “substantive assistance.”
Apple has given investigators materials from the iCloud account of the gunman, Second Lt. Mohammed Saeed Alshamrani, a member of the Saudi air force training with the American military, who killed three sailors and wounded eight others on Dec. 6. But the company has refused to help the F.B.I. open the phones themselves, which would undermine its claims that its phones are secure.
Justice Department officials said that they need access to Mr. Alshamrani’s phones to see messages from encrypted apps like Signal or WhatsApp to determine whether he had discussed his plans with others at the base and whether he was acting alone or with help.
“The evidence shows that the shooter was motivated by jihadist ideology,” Mr. Barr said, citing a message that Mr. Alshamrani posted on last year’s anniversary of the Sept. 11 attacks warning that “the countdown has begun.” He also visited the 9/11 memorial in New York over the Thanksgiving holiday.
Mr. Alshamrani also posted anti-American, anti-Israeli and jihadist messages on social media, including just two hours before he attacked the base, Mr. Barr said.
Mr. Barr turned up the pressure on Apple a week after the F.B.I.’s top lawyer, Dana Boente, asked the company for help searching Mr. Alshamrani’s iPhones. Apple said that it would turn over only the data it had, implying that it would not work to unlock the phones and hand over the private data on them.
Apple’s stance set the company on a collision course with a Justice Department that has grown increasingly critical of encryption that makes it impossible for law enforcement to search devices or wiretap phone calls.
The confrontation echoed the legal standoff over an iPhone used by a gunman who killed 14 people in a terrorism attack in San Bernardino, Calif., in late 2015. Apple defied a court order to assist the F.B.I. in its efforts to search his device, setting off a fight over whether privacy that was enabled by impossible-to-crack encryption harmed public safety.
As in the investigation into the Pensacola shooting, the San Bernardino gunman, Syed Rizwan Farook, was also dead and no longer had a right to privacy. In both cases, law enforcement officials worked to piece together a clear motive and any ties to extremist groups.
The San Bernardino dispute was resolved when the F.B.I. found a private company to bypass the iPhone’s encryption. Tensions between the two sides, however, remained; and Apple worked to ensure that neither the government nor private contractors could open its phones.
Mr. Alshamrani’s phone are also of interest because he tried to destroy them at some point before he began firing, according to a Justice Department official who spoke on condition of anonymity because the investigation is ongoing.
Justice Department officials have long pushed for a legislative solution to the problem of “going dark,” law enforcement’s term for how increasingly secure phones have made it harder to solve crimes, and the Pensacola investigation gives them a prominent chance to make their case.
But the F.B.I. has been bruised by Mr. Trump’s unsubstantiated complaints that former officials plotted to undercut his presidency and by a major inspector general’s report last month that revealed serious errors with aspects of the Russia investigation. A broad bipartisan consensus among lawmakers allowing the bureau to broaden its surveillance authorities is most likely elusive.
But much has also changed for Apple in the years since Tim Cook, the chief executive of Apple, excoriated the Obama administration publicly and privately in 2014 for attacking strong encryption. Obama officials who were upset by Apple’s stance on privacy, along with its decision to shelter billions of dollars in offshore accounts and make its products almost exclusively in China, aired those grievances quietly.
Now Apple is fighting the Trump administration, and President Trump has shown far more willingness to publicly criticize companies and public figures. When he recently claimed falsely that Apple had opened a manufacturing plant in Texas at his behest, the company stayed remained silent rather than correct him.
At the same time, Apple has financially benefited more under Mr. Trump than under President Barack Obama. It reaped a windfall from the Trump administration’s tax cuts, and Mr. Trump said he might shield Apple from the country’s tariff war with China.
Even so, people close to the company say that Apple will not back down from its unequivocal support of encryption that is impossible to crack.
Mr. Barr indicated on Monday that he is ready for a sharp fight.
He had said last month that finding a way for law enforcement to gain access to encrypted technology was one of the Justice Department’s “highest priorities.”
Mr. Alshamrani, who was killed at the scene of the attack, came to the United States in 2017 and soon started strike-fighter training in Florida. Investigators believe he may have been influenced by extremists as early as 2015.
The investigation into the shooting also found that some Saudi students training with the American military in Pensacola had ties to extremist movements while others possessed pornography, which is forbidden in Saudi Arabia. About a dozen trainees will be sent back to Saudi Arabia as a result.
Investigators have not found evidence to suggest that any of those students knew about Mr. Alshamrani’s contact with extremist groups or his mass shooting plan.