The Saudi military trainee who fatally shot a Georgia man and two other sailors at Naval Air Station Pensacola on Dec. 6 had significant ties to Al Qaeda's affiliate in Yemen and began his preparations for the attack years ago, the U.S. Justice Department announced Monday.

Radicalized by 2015, Second Lt. Mohammed Saeed Alshamrani joined the Royal Saudi Air Force to carry out a “special operation,” U.S. Attorney General William Barr and FBI Director Christopher Wray told reporters. Alshamrani, they said, communicated with Al Qaeda in the Arabian Peninsula up until the attack.

Using evidence obtained from Alshamrani’s two iPhones, Barr said, U.S. forces recently carried out “a counterterrorism operation” in Yemen against Abdullah al-Maliki, an operative with Al Qaeda’s Yemen branch, also known as AQAP. One of Alshamrani’s associates, al-Maliki issued the group’s claim of responsibility for the shootings in Pensacola.

Barr would not say whether there was an airstrike and if al-Maliki was killed, but he offered: “I am very pleased with the results of the counterterrorism operation and believe it has further degraded the capabilities of Al Qaeda in the Arabian Peninsula.”

Cameron Walters, 21, an Effingham County High School graduate from Richmond Hill, was among the three sailors killed in the shooting. All three were students at Naval Aviation Schools Command. Eight others were injured. Alshamrani was studying at the same institution. A sheriff’s deputy who responded to the attack killed him.

The Navy posthumously promoted Walters to naval aircrewman mechanical 3rd Class on Dec. 12. Four days later, hundreds of mourners attended a funeral service for him in Savannah. Walters' family did not respond to requests for comment Monday

The Defense Department said it has bolstered its vetting process for foreign military students and placed new restrictions on their access to firearms and U.S. military installations.

“Despite this tragic event, our military partnerships and the international military student program remain strong and are a vital component of our National Defense,” the Pentagon said Monday.

Wray revealed other details about the evidence collected from the two iPhones, saying Alshamrani associated with AQAP while living in Texas and Florida and talked with the group about "his plans and tactics — taking advantage of the information he acquired here, to assess how many people he could try to kill."

“He was meticulous in his planning,” Wray said. “He made pocket-cam videos as he cased his classroom building. He wrote a final will, purporting to explain himself, and saved it in his phone — the exact same will that AQAP released two months later when they initially claimed responsibility.

“He wasn’t just coordinating with them about planning and tactics — he was helping the organization make the most it could out of his murders. And he continued to confer with his AQAP associates right until the end, the very night before he started shooting.”

Alshamrani, according to Wray and Barr, communicated with AQAP “using end-to-end encrypted apps, with warrant-proof encryption, deliberately in order to evade law enforcement.”

Also Monday, Barr accused Apple of refusing to help access the locked contents on Alshamrani’s iPhones. Alshamrani attempted to destroy them, Barr said, at one point pausing during the gunfight to fire a bullet into one.

"When combating threats to our homeland, we need American tech leaders to work with us, not against us," Barr said. "Over the past year, I have repeatedly asked tech companies to work with us to provide better solutions. Unfortunately, no progress has been made. For the safety and security of our citizens, we cannot afford to wait any longer."

Apple said Monday that it has supported the FBI during its investigation, adding that “false claims made about our company are an excuse to weaken encryption and other security measures that protect millions of users and our national security.”

“It is because we take our responsibility to national security so seriously that we do not believe in the creation of a backdoor — one which will make every device vulnerable to bad actors who threaten our national security and the data security of our customers. There is no such thing as a backdoor just for the good guys, and the American people do not have to choose between weakening encryption and effective investigations.”