WASHINGTON (AP) — The United States is removing nearly two dozen Saudi military students from a training program and sending them back to Saudi Arabia following after an investigation into a deadly shooting by a Saudi aviation student at a Florida navy base last month, Attorney General William Barr said Monday.

Many of the 21 cadets had contact with child pornography and possessed jihadist or anti-American material, Barr said. None is accused of having advanced knowledge of the shooting, which Barr said was motivated by “jihadist ideology” and has been classified as an act of terrorism.

The 21-year-old Saudi Air Force officer, 2nd Lt. Mohammed Alshamrani, opened fire at the base in Pensacola, killing three U.S. sailors and injuring eight other people. The Justice Department has been investigating the incident as an act of terrorism.

Officials have said Alshamrani hosted a party before the shooting, where he and others watched videos of mass shootings. The gunman had also apparently taken to Twitter before the shooting to criticize U.S. support of Israel and accuse America of being anti-Muslim, another U.S. official told the AP last month.

Alshamrani, who was killed by a sheriff’s deputy during the rampage at a classroom building, was undergoing flight training at Pensacola, where foreign military members routinely receive instruction.

It was not immediately clear on what grounds the students were being removed from the program, though the official said they were not suspected of having played any role in the attack. The precise number of students being removed was also not clear. The officials discussing the case spoke on condition of anonymity to speak about details involved in an ongoing investigation.

The plan to remove the students was first reported by CNN.

The December shooting raised questions about how well international military students are screened before they attend training at American bases. Some lawmakers, including a top Republican ally of President Donald Trump, have called for Saudi Arabia to be suspended from an American military training program.

Trump called for the program to be reviewed. But Sen. Lindsey Graham, R-S.C., said the program needed to be reevaluated after the attack.

A Saudi commanding officer had ordered all students from the country to remain at one location at the base after the attack.

National security adviser Robert O’Brien said in an interview on Fox News that the shooting “showed that there had been errors in the way that we vetted” the students. The actions being taken by the Justice Department and Defense Department to remove the Saudi students are to “protect our service men and women,” he said.

Federal officials are still investigating the shooting and examining evidence. Earlier this week, FBI asked Apple to help extract data from two iPhones that belonged to the gunman.

Investigators have been trying to access the two devices — an iPhone 7 and an iPhone 5 — but have been unable to access them because the phones are locked and encrypted, according to a letter from the FBI’s general counsel, Dana Boente. The FBI has received a court authorization to search the phones and the devices have been sent to the bureau’s lab in Quantico, Virginia, he said.

The investigation is considered a “high-priority national security matter,” Boente said in the letter.

FBI officials have sought help from other federal agencies and other experts, and investigators have been trying to guess the passwords, but those efforts have been unsuccessful, according to the letter.

Apple said in a statement that it has already provided investigators with all the relevant data held by the company and would continue to support the investigators.

At least one of the phones was shot by a sheriff’s deputy during the attack, but investigators believe they may still be able to extract data from the device, according to a person familiar with the matter. The person spoke on condition of anonymity to discuss an ongoing investigation.