WASHINGTON (Reuters) – The FBI found cellphone evidence linking al Qaeda to the Royal Saudi Air Force trainee who killed three American sailors in a December attack at a U.S. naval base in Florida after cracking his phone open, Attorney General William Barr said on Monday.

The shooter, Second Lieutenant Mohammed Saeed Alshamrani, 21, was killed by law enforcement during the Dec. 6, 2019 attack. 

He was on the base as part of a U.S. Navy training program designed to foster links with foreign allies. 

The Justice Department succeeded in unlocking the encryption on the shooter's iPhone after Apple Inc declined to do so, Barr told reporters on a conference call. 

“The information from the phone has already proved invaluable,” Barr said. 

In February, an audio recording purporting to be from the Islamist militant group al Qaeda in the Arabian Peninsula (AQAP) claimed responsibility for the fatal attack, but it provided no evidence. 

Prior to the shooting spree, which also wounded eight people, the shooter posted criticism of U.S. wars and quoted slain al Qaeda leader Osama bin Laden on social media. 

“The evidence we have been able to develop … shows that the Pensacola attack was actually the brutal culmination of years of planning,” FBI Director Christopher Wray said on the same call, adding that evidence showed Alshamrani had been radicalized by 2015. 

The Justice Department previously said that Alshamrani visited the New York City memorial to the victims of the Sept. 11, 2001, attacks on the United States – carried out by Saudi hijackers for the Islamist militant group al Qaeda – and posted anti-American, anti-Israeli and jihadi messages on social media, including two hours before the attack. 

Earlier this year, Barr accused Apple of failing to help the FBI to get Alshamrani’s two cellphones unlocked, an allegation Apple staunchly denied. 

Barr has said the Saudi government did not have any advanced warnings of the shooting. 

However, in January, Saudi Arabia withdrew its remaining 21 cadets from the U.S. military training program and brought them back to Saudi Arabia, after the Justice Department's investigation revealed that some of them had accessed child pornography or had social media accounts containing Islamic extremist or anti-American content. 

(Reporting by Mark Hosenball and Sarah N. Lynch; additional reporting by Susan Heavey; Editing by Chizu Nomiyama, David Gregorio and Steve Orlofsky)