Twenty-one members of the Saudi Arabian military are being expelled from the US after a cadet last month fatally shot three sailors at a Florida air base.
The servicemen are not accused of aiding the 21-year old Saudi Air Force lieutenant.
But US Attorney General William Barr said the cadets were found to have shared jihadist posts and child pornography on social media.
Training for Saudi servicemen was put on hold in the US after the attack.
Mr Barr told a news conference on Monday that the 6 December shooting at Naval Air Station Pensacola had been an “act of terrorism”.
America’s top law official said initial reports that other Saudi cadets had filmed the attack as it unfolded were inaccurate.
The gunman had arrived at the scene of the shooting alone, said Mr Barr.