A Saudi Air Force officer who went on a deadly gun rampage at a US naval base in December 2019 worked with Al Qaeda in the Arabian Peninsula (AQAP) to plan the attack, US officials say.
The gunman's phone revealed the terror link, the FBI and Department of Justice said.
The attack in Pensacola, Florida killed three US sailors and injured eight.
Prosecutors criticised Apple for refusing to unlock the gunman's phones, which authorities took months to hack.
The attack led to the expulsion of 21 Saudi military pupils who had been studying at the base with the attacker.
According to the FBI, the gunman, who was killed by authorities after shooting 11 people, had been radicalised before arriving Florida for a three-year aviation course the US navy hosts for allied foreign servicemen.
Records revealed that he had been in active contact with AQAP, an off-shoot of al-Qaeda based in Yemen, up to the shooting, including talking about plans to carry out a "special operation" for them.
The group's leader, Qasim al-Raymi, was confirmed in February to have been killed during a US operation. AQAP had released an audio message earlier that month with Raymi's voice, in which he said the group was behind the naval base shooting.
FBI Director Christopher Wray said that gunman was "more than inspired" by AQAP, sharing tactics and "co-ordinating" with the group on plans for attack.
The attack strained US-Saudi relations and led the Defence department to pause all international military training in the US until further vetting measures could be put in place.
'Apple did nothing to help'
In disclosing details of the terror investigation on Monday, the Trump administration criticised Apple for refusing to help unlock the gunman's phones, which he had attempted to destroy before he was shot dead following the attack.
Hacking into his two phones four months after the attack diverted attention from other important work and gave conspirators time to evade justice, Mr Wray and Attorney General William Barr said.
"Apple has made a business and marketing decision to allow only the user to unlock their phones, no matter the circumstances," said Mr Barr, adding that the company had ignored a personal request from President Donald Trump.
"Apple's decision has dangerous consequences for public safety and the national security, and is in my judgement, unacceptable," he added, calling on new laws to mandate Apple's future co-operation.
Mr Wray told reporters that the phones had already yielded valuable intelligence, which led directly to a US counter-terror operation in Yemen.
Apple has denied FBI requests to unlock its iPhone devices in several high profile mass shooting cases, citing largeRead More – Source