The gunman who opened fire inside a classroom at the U.S. Naval Air Station Pensacola on Friday morning, killing three people and injuring seven others, was a member of the Saudi Air Force who was at the Florida base for training, officials said.

The suspect—who has not been publicly identified by authorities—was shot and killed by a deputy during the attack at the Florida Panhandle facility, which is known as the “cradle of aviation,” the Escambia County Sheriff’s Office confirmed.

Multiple news outlets identified the shooter as Second Lt. Mohammed Saeed Alshamrani. Officials said he was scheduled to complete the three-year training program in August.

“The government of Saudi Arabia needs to make things better for these victims, and I think they’re going to owe a debt here given that this is one of their individuals,” Florida Gov. Ron DeSantis said at a press conference.

According to The New York Times, Alshamrani was armed with a Glock 45 9 mm handgun with an extended magazine that had been bought locally. He reportedly had several other magazines on him.

Authorities are investigating whether the incident was related to terrorism, and the FBI has taken over the investigation into the shooting, according to a spokeswoman for the Bureau.

The FBI was scouring social media for any messages from the gunman, presumably including a tweet with anti-American sentiments posted before the shooting that some terrorism experts said appeared to be from the suspect’s account.

Naval Air Station Pensacola is the site of an international training program for members of the Royal Saudi Naval Forces. Just last month, 18 aviators and two aircrew members from the kingdom completed a program that the U.S. military says is similar to the training American personnel gets. Base commander Capt. Tim Kinsella said Friday there are currently a “couple hundred international students” stationed at the Florida training camp.

The sheriff’s office confirmed the shooting left a total of four dead, including the gunman. Baptist Hospital told The Daily Beast that it received eight patients, one of whom died from their injuries.

“We do not have any conditions to report at this time,” hospital spokesperson Kathy Bowers told The Daily Beast. “Our teams are treating patients and we are working with Navy personnel to communicate with family members.”

After receiving a report of an active shooter at 6:51 a.m., deputies approached the gunman armed with a handgun at a classroom building at the naval base. Two deputies were shot—one in the knee and one in arm—while trying to apprehend the suspect.

Both were transported to a local hospital are being treated for non-life threatening injuries. The deputy who was shot in the knee is in surgery.

“Walking on the crime scene was like walking onto the set of a movie,” Escambia County Sheriff David Morgan said during a press conference, adding that authorities have no reason to believe there are any additional suspects.

Pensacola’s mayor, Grover Robinson, said Friday’s incident is a “tragic day” for the city and asked residents to stay away from the area. “We are a military town,” Robinson said. “We will overcome this, but today this is certainly a tragic day.”

President Donald Trump tweeted Friday that he had been briefed on the situation, and King Salman of Saudi Arabia “called to express his sincere condolences and give his sympathies to the families and friends of the warriors who were killed and wounded in the attack.”

“The King said that the Saudi people are greatly angered by the barbaric actions of the shooter, and that this person in no way shape or form represents the feelings of the Saudi people who love the American people,” Trump said.

According to CNN, King Salman also ordered his security services to cooperate with U.S. officials in their investigation.

Saudi Arabia’s Minister of State for Foreign Affairs Adel al-Jubeir also expressed his “deepest sympathies and heartfelt condolences...to the families of those impacted by the tragedy that unfolded at Pensacola, Florida” in a Friday tweet.

Escambia County Commissioner Jeff Bergosh, who works at NAS Pensacola as a civilian contractor, told the Pensacola News Journal on Friday he was about to enter the base’s gate when it was suddenly shut down.

“There’s probably been 100 or so various law-enforcement vehicles zooming down the wrong side on Navy Boulevard,” Bergosh said, adding he received a call from his coworkers who were inside the base.

According to its website, NAS Pensacola employs more than 16,000 military and 7,400 civilian personnel and is one of the Navy’s most storied bases. The downtown facility, which is the primary training base for all U.S. Navy, Marine Corps, and Coast Guard officers pursuing careers as naval aviators and naval flight officers, also includes the National Naval Aviation Museum and is the home of the Blue Angels.

“The base is closed for the remainder of the day. Only essential personnel will be allowed onto the base,” the base said in a Facebook post.

The situation came two days after a U.S. sailor killed two Defense Department civilian employees before taking his own life at the Pearl Harbor Naval Shipyard, near Honolulu. According to the Honolulu Star-Advertiser, that gunman has been identified as Gabriel Romero, who was assigned to a Pearl Harbor-based submarine, the USS Columbia.

On Saturday, a Virginia man also rammed into a security vehicle at Joint Expeditionary Base Little Creek-Fort Story, killing a sailor. Nathaniel Lee Campbell, 38, was charged Thursday night with involuntary manslaughter for the death of 23-year-old Petty Officer 3rd Class Oscar Jesus Temores.

United States Secretary of Defense Mark Esper offered his condolences on Friday to families of the victims of both Pearl Harbor and Pensacola.

“I’m grateful for the heroism of the first responders and law enforcement who helped confront both situations and kept further loss of life from occurring,” Esper said in a statement. “To all our sailors, soldiers, airmen, and marines, and civilian personnel, we stand ready to assist and make resources available to deal with the grief in the aftermath of these tragedies as well as life’s challenges in general.”