(CNN) —  

Mohammed Alshamrani was supposed to finish his flight training at Naval Air Station Pensacola in Florida in August 2020, according to the Department of Defense.

He was killed in a shootout with police last week after he opened fire in a classroom building. Three sailors were killed and several others were wounded as a result of the shooting, officials said.

The FBI is now treating last week’s shooting as “act of terror,” but Alshamrani’s motive remains unknown.

A US defense official provided a timeline of Alshamrani’s time in the US to CNN.

Here’s what we know:

2017: Arrives in Texas

Alshamrani began his training in August 2017, when he arrived in Texas to attend a year of an American language course and general English training at Lackland Air Force Base, the defense official’s timeline read.

He was a second lieutenant in the Saudi air force, Florida Gov. Ron DeSantis said.

Alshamrani was vetted before his entry into the pilot training program and nothing of concern was found, a law enforcement source told CNN.

2018: Arrives in Florida

Alshamrani arrived in Florida on May 20 for pilot training at Naval Aviation Schools Command (NASC) in Pensacola, the timeline read.

He was part of an ongoing US military program training members of foreign militaries, including Saudi Arabia’s. There are currently 852 Saudis in the US for Defense Department security cooperation training, said Commanding Officer of NAS Pensacola Capt. Tim Kinsella.

For the next year and a half, he took classes that covered aviation preparation, swimming qualifications and Naval Flight Officer (NFO) training, according to the timeline.

October 2019: Takes student leave

Alshamrani took “student leave” from October 17 to 23. It is not clear what he did during these six days, but he was in Pensacola and received temporary lodging allowance, according to the timeline.

October 2019: Starts advanced training

Alshamrani began advanced training in late October, and stayed in the program until the shooting.

This advanced portion of the program saw Alshamrani training as a strike fighter undergraduate military flight officer (UMFO), according to the timeline.

November 2019: Travels to New York

Alshamrani and a small group of Saudi nationals also traveled to New York City over the Thanksgiving holiday, a law enforcement official told CNN. They visited several museums and Rockefeller Center, the source said, but authorities don’t know why they traveled to the city.

December 2019: Hosts a dinner party

Some of the Saudi nationals on base with Alshamrani told officials he hosted a dinner party ahead of the attack at which the group watched mass shooting videos, a source familiar with the investigation told CNN.

It is not clear when the dinner party was held.

December 2019: Carries out the attack

The shooting took place in a classroom building, authorities said. Alshamrani used a handgun and was killed after two deputies exchanged gunfire with him, according to officials.

It is unclear how Alshamrani got a gun on base because weapons are not allowed, authorities said.

Minutes before authorities were alerted to the attack, a Twitter account aligning with the shooter’s name posted a message inspired by al-Qaeda and its founder, Osama bin Laden, CNN’s Nic Robertson and Paul Cruickshank wrote.

The message, addressed to the American people, declared hate for Americans because of their “crimes” against Muslims. It made no reference to an impending attack. Instead, it repurposed words used by bin Laden and the American al Qaeda terrorist cleric Anwar al-Awlaki.

CNN’s Steve Almasy, Christina Maxouris and David Shortell contributed to this report.