An aviation student from Saudi Arabia opened fire in a classroom building at the Naval Air Station in Pensacola on Friday morning, a U.S. official said, an attack that left three dead in addition to the assailant.

The assault was the second at a U.S. Navy base this week and prompted a massive law enforcement response and a lockdown at the base.

The student, who was fatally shot by a sheriff’s deputy, was a second lieutenant in the Saudi Air Force, said two U.S. officials who spoke on condition of anonymity to disclose information that had not yet been made public. The officials said authorities were investigating whether the attack was terrorism-related.

Eleven people were shot all together, including two sheriff’s deputies who were the first to respond, one of whom killed the shooter, Escambia County Sheriff David Morgan said. One of the deputies was shot in the arm and the other in the knee, and both were expected to recover, he said.

The base remained closed until further notice and those still there would be evacuated when authorities decided it was safe to do so, Kinsella said.

Lucy Samford, 31, said her husband, a Navy reservist and civilian worker on the base, was about 500 yards from where the shooting happened. She said she got a call from him a little after 7 a.m. and “one of the first things out of his mouth was, ‘I love you. Tell the kids I love them. I just want you to know there’s an active shooter on base.'”

Her husband, whom she declined to identify, later told her he was OK.

NAS Pensacola employs more than 16,000 military and 7,400 civilian personnel, according to its website. One of the Navy’s most historic and storied bases, it sprawls along the waterfront southwest of downtown Pensacola and dominates the economy of the surrounding area.

Part of the Pensacola base resembles a college campus, with buildings where 60,000 members of the Navy, Marines, Air Force and Coast Guard receive training each year in multiple fields of aviation.

The base is home is home to the Blue Angels flight demonstration team, and includes the National Naval Aviation Museum, a popular regional tourist attraction.

The shooting is the second at a U.S. naval base this week. A sailor whose submarine was docked at Pearl Harbor, Hawaii, opened fire on three civilian employees Wednesday, killing two before taking his own life.

Alex McGinley, a tattoo artist who works near the Pensacola base, said he was alerted to the shooting by one of his clients, most of whom are military personnel. He said none of his clients was among those shot.

“What kind of things go through a person’s mind to a level that makes them do something like that?” McGinley asked.

Associated Press reporters Lolita Baldor and Ben Fox in Washington and Freida Frisaro in Miami contributed to this report.