The suspected gunman who killed three people and injured several others at a naval base in Pensacola, Florida, on Friday morning was a Saudi national, according to law enforcement sources.
Sources identified the shooter, who was killed in the incident, as Mohammed Saeed Alshamrani.
The FBI was the lead agency in charge of the investigation as of Friday afternoon.
More from NBC News:
Teens, young adults are using TikTok to raise awareness for Uighur Muslims
'Supergirl' star says in emotional Instagram she was victim of domestic abuse
Anti-vaccine groups take dangerous harassment offline and into the real world
Two Escambia County sheriff's deputies were on scene immediately after reports of a shots fired at about 6:50 a.m. local time. They were injured in an exchange of gunfire with the shooter, authorities said.
One was shot in the arm and the other was shot in the leg and was in surgery, Chief Deputy Chip Simmons said during a morning news conference. They are both expected to survive.
"Walking through the crime scene was like being on the set of a movie," Sheriff David Morgan told reporters.
In addition to the two officers, six other people were injured, officials said.
The base was still on lockdown at about 10 a.m. and was to remain closed for the rest of the day, with only essential personnel allowed to enter. Pensacola Mayor Grover C. Robinson also asked residents to avoid the area around the base as investigators swarmed the scene.
The shooting unfolded in a two-floor classroom building at the base, which is a training facility.
Jeff Bergosh, a facilities manager at the base, had just arrived at the front gates when the station was put on lockdown, trapping thousands of workers in their cars.
"It's been pretty surreal," Bergosh told MSNBC. "We're just praying for all the victims."
He said more than 10,000 workers come to Naval Air Station Pensacola every day — many entering from Navy Boulevard, which Friday morning became a mileslong parking lot when the lockdown was ordered.
"When this happened was prime-time rush hour for all the base employees," Bergosh said. "It was chaos with the ambulances and the police vehicles screaming by with the sirens. We knew pretty quickly that this was a pretty serious event."
"Both gates of NASP are currently secured due to reports of an active shooter," a post said early Friday on the station's Facebook page.
President Donald Trump has been briefed on the shooting and is monitoring the situation, the White House said.
Vice President Mike Pence tweeted: "Saddened to hear of the horrible shooting at Naval Air Station Pensacola & continuing to monitor the situation. Praying for the victims & their families & we commend the first responders for their swift action in taking down the shooter & getting those on base to safety."
It is the second shooting at a U.S. military facility this week. On Wednesday, a U.S. sailor fatally shot two civilian Defense Department employees and wounded a third at the Pearl Harbor Naval Shipyard in Hawaii before killing himself, according to military officials.
The naval base incident Friday also comes one day after rumors of a shooting at a school in the same county, the Escambia County School District's Tate High School. The district office said the threats were not credible, but extra security was sent to the school.
Naval Air Station Pensacola employs more than 16,000 military and 7,400 civilian personnel. It was the nation's first naval air station and is the home of the popular Blue Angels flight demonstration squadron and the National Naval Aviation Museum, making it a popular tourist destination. It is also the headquarters of the Naval Education Training Command.
In 2016, the base was relatively late to enact security measures to separate the nearly 1 million tourists who visit each year from the sailors, Marines and other base employees, the Navy Times reported.
The naval air station established separate entrance gates for people who worked at the base and visitors, which are about three miles apart. Tourists also can't access military areas without passing through guard booths and roadblocks.