(CNN) The shooting at a Naval air base in Pensacola, Florida, last month was an act of terrorism motivated by "jihadist ideology," Attorney General William Barr said at a news conference Monday.

Three US sailors were killed when 21-year-old Mohammed Alshamrani, a member of the Royal Saudi Air Force who was training at Naval Air Station Pensacola, entered a building on base and "proceeded to walk around shooting down his unarmed victims in cold blood," Barr said.

Alshamrani, who was killed by law enforcement during the attack, had a history of airing his anti-American, anti-Israel and jihadi messages views on social media, including in a post on September 11 stating that "the countdown has begun," and another post made two hours before the attack, Barr said.

During a 15-minute shooting spree, Alshamrani shot at a photo of President Donald Trump as well as a former president, according to FBI Deputy Director David Bowdich. He also made statements while he was shooting that were critical of American servicemen overseas, Bowdich said.

The Pensacola shooting drew immediate scrutiny to the system of accepting foreign military trainees on US bases. Barr defended the program on Monday, calling Saudi Arabia "an important military partner," and said that Saudi Arabia had been fully cooperative in the investigation.

Read More