See more of the story

– Attorney General William Barr declared 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 the gunman's two phones.

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," Barr said, calling on Apple and other tech 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, 2nd Lt. Mohammed Saeed Alshamrani, a member of the Saudi Air Force training with the U.S. military, who killed three sailors and wounded eight others on Dec. 6.

But the company has refused to help the FBI open the phones themselves, which would undermine its claims that its phones are secure.

Justice Department officials said that they need access to 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," Barr said, citing a message that Alshamrani posted on last year's anniversary of the Sept. 11 attacks warning that "the countdown has begun." He also visited the Sept. 11 memorial in New York over the Thanksgiving holiday.

Alshamrani also posted anti-American, anti-Israeli and jihadist messages on social media, including just two hours before he attacked the base, Barr said.

Barr turned up the pressure on Apple a week after the FBI's top lawyer, Dana Boente, asked the company for help searching 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 critical of encryption that makes it impossible for law enforcement to search devices or tap phone calls.

Alshamrani's phones 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.

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 FBI has been bruised by President Donald 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 authority is most likely elusive.

But much has also changed for Apple in the years since CEO Tim Cook 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 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 remained silent rather than correct him.

At the same time, Apple has financially benefited more under Trump than under President Barack Obama.

It reaped a windfall from the Trump administration's tax cuts, and Trump said he might shield Apple from the country's tariff war with China.

Even so, people close to the company said that Apple will not back down.

Barr indicated Monday that he is ready for a sharp fight. He 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."

Alshamrani, who died 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 U.S. military in Pensacola had ties to extremist movements while others possessed pornography, which is forbidden in Saudi Arabia. The U.S. is sending home 21 Saudi military students following the investigation into the shooting. On Monday, Barr said the deadly attack was an act of terrorism driven by some of the same motivations of the Sept. 11 plot.

The trainees who are being removed had jihadist or anti-American sentiments on social media pages, including in internet chat rooms, officials said. Investigators have not found evidence to suggest that any of those students knew about Alshamrani's contact with extremist groups or his mass shooting plan.

The Associated Press contributed to this report.