The carnage at Naval Air Station Pensacola and at the Pearl Harbor Naval Shipyard near Honolulu are just the latest examples of the unexpected challenges military brass face in protecting armed services personnel.
Experts also say they illustrate the evolution of attacks on military installations.
"Barriers and fences are not going to stop an attack by a disaffected, mentally unwell, violence-prone individual who has access to the base," said John Cohen, an ABC News Contributor and the former counterterrorism coordinator for the Department of Homeland Security.
The investigations into both the Pensacola and Pearl Harbor attacks are ongoing and officials have not commented on motives for the lethal episodes unleashed by two suspected active shooters in uniform.
Near back-to-back shootings at bases
Last Wednesday, 22-year-old active-duty sailor G. Romero, armed with two service pistols, allegedly opened fire on three civilian Department of Defense workers at the Pearl Harbor Naval Shipyard, killing two and wounding one before fatally shooting himself, authorities said. Romero served on the USS Columbia, a submarine stationed at Pearl Harbor.
Then on Friday, Mohammed Alshamrani, 21, a Saudi national and second lieutenant in his country's air force, who was in the United States for flight training, opened fire in a classroom at the Pensacola base, killing three U.S. Naval airmen with a handgun authorities say he purchased legally. Alshamrani was shot to death by responding deputies from the Escambia County Sheriff's Office.
Other military base shootings in 2019
The Pearl Harbor and Pensacola incidents marked the third and fourth shootings at stateside U.S. military bases this year.
On Jan. 1, a 20-year-old Marine was killed at the Marine Barracks in Washington D.C., when a fellow Marine, Lance Cpl. Andrew Johnson, now facing a murder charge, allegedly pulled a pistol and shot him in the head, officials said. It is unclear if Johnson entered a plea.
On April 5, a female sailor was shot and wounded at the Naval Air Station Oceana in Virginia Beach, Virginia, allegedly by Airman Apprentice Christopher Ruffier, 26, who was killed by base security officers, officials said. The shooting stemmed from a domestic violence dispute, officials said.
Cohen said the shootings, specifically those in Hawaii and Pensacola, have posed the military new challenges on how to protect personnel from people authorized to be on military bases.
'Porn Stash' complaint
Cohen said that the thinking was once to "set up fences and walls because you're worried about an attack coming from outside."
"Now you've got to worry about the person sitting in the cubical next to you," Cohen added. "And that changes the security dynamic within an organization that makes it much more difficult to protect everybody...
"The only real way to do it is for people to be keying off behavioral characteristics of individuals and then when they see concerning behavior to take action on it."
In the Pensacola shooting, FBI agents are trying to determine if anyone helped Alshamrani plan the deadly rampage. He arrived in the United States for training in August 2017 and initially spent time studying English at the Lackland Air Force Base in Texas before transferring to Advanced Strike Fighter Training in Pensacola, according to his military records.
Investigators are probing a report that Alshamrani viewed mass-shooting videos in the presence of some friends in the days leading up to the attack, two people briefed on the probe told ABC News.
Investigators have also looked into an incident that occurred in April in which an instructor at the Pensacola base mocked Alshamrani's appearance in front of about 10 other students by referring to him as "Porn Stash" in an apparent reference to the suspect's mustache, two officials briefed on the probe told ABC News. The incident was first reported by The New York Times, who cited a complaint the suspect filed in which he claimed he was "infuriated" by the comment.
"As far as our investigation, we are investigating this as an act of terrorism," FBI Director Christopher Wray told ABC News on Monday. "And at the moment the investigation is very fluid and active and ongoing. So I probably shouldn’t be commenting on the latest state of play in terms of factual development.”
Red flags missed at Fort Hood
Donald J. Mihalek, a retired U.S. Secret Service agent and an ABC News contributor, said the 2009 mass shooting at Fort Hood, which left 13 people dead and 30 injured, prompted military officials to reassess security at bases. The shooting, the deadliest mass shooting at an American military base, was committed by Nidal Hasan, a U.S. Army major and psychiatrist, who in hindsight investigators learned was radicalized and had corresponded with Anwar al-Awlaki, the Al Qaeda preacher killed in a CIA drone strike in Yemen in September 2011.
Hasan was convicted and received a death sentence. He remains on federal death row.
"You always hear in the aftermath of these active-shooter investigations, whether it's on a military base or any other place, that people always say, 'Oh, well so-and-so did this or they acted just like this.' You rarely, rarely hear, 'Oh, I had no idea,'" Mihalek said. "There's always either a behavior or a social media thing these days, or they say something or there's a grievance that is known to people, that propels them to perform these acts."
National Insider Threat Awareness Month
Both Mihalek and Cohen said the military has concentrated on detecting red flags in an attempt to thwart attacks.
In September, the Department of Defense released a report encouraging military personnel on how to "keep the workplace safe" as part of an employee awareness campaign that coincided with the National Insider Threat Awareness Month.
"Insider threats are posed by employees or anyone else who has been granted trusted access to DOD information systems, installations, or facilities who commit a harmful act, intentional or not," the report reads. "The department's counter-insider threat program aims to teach analysts in the various DOD component hubs to recognize concerning behaviors and potential threats."
"What we are trying to do is tell people if you hear that, if you see that, if you sense that, pay attention to that. To prevent damage and avert casualties, we need the workforce's help," Dr. Brad Millick, director of the DOD's counter-insider threat program, wrote in the report.
The report advises military personnel to be aware of warning signs like threatening statements or signs of disgruntlement from colleagues.
The Army has also been exploring smart technology, including using autonomous vehicles to patrol bases and artificial intelligence to analyze data of a military installation's facilities, according to an article posted in May on the Army's website.
"The homeland is no longer a sanctuary," Richard Kidd, deputy assistant secretary of the Army for strategic integration, said in the article. "We've been treating our military installations as if they were sanctuary cities for a very long time, immune from the effects of the adversary. That is no longer the appropriate assumption."
Mihalek said that in most military base shootings committed by insiders "there's a stressor, or preemptive factor that pushes people to act out."
"And one of the stressors that have been identified both by the Secret Service and the FBI for all these active shooters, or insider situations, is personal slights, personal grievances," Mihalek said.
"But the problem is, these days a lot of folks don't want to take those questions to the next step and go, 'Well, Joe's not acting right. Let's talk to Joe and figure out what's going on here or let's see what Joe is doing because we don't like what we're seeing here,'" Mihalek said. "Even 'till this day with all these incidents, you still have these organizations -- schools, businesses, the military -- very politically correct, they're very hesitant to go to that next step."
Such standoff attitudes can allow red flags to go undetected from authorities.
Despite lessons learned by the military from the Hasan rampage, another mass shooting occurred at Fort Hood in 2014, carried out by Army Spc. Ivan Lopez, who killed three people and injured 12 before taking his own life. The Army concluded in 2015 that there were “no clear warning signs” in his military and personnel records that would have indicated Lopez would act violently.
While in the weeks and months before the shootings, Lopez was experiencing financial stress and dealing with the emotional blow of the deaths of his mother and grandfather, the Army's report determined it “cannot reasonably conclude that any single event or stressor, in isolation, was the cause of the shooting."
In 2013, former Navy reservist Aaron Alexis went on a shooting rampage at the Washington Navy Yard in the District of Columbia, killing 12 people. Investigators said Alexis, who was killed in a gunfight with police, was employed by Hewlett-Packard as an IT subcontractor for the Navy and gained access to the Navy Yard building where the massacre occurred by using a valid pass.
Following the massacre, investigators learned that Alexis had exhibited numerous red flags, including several arrests for disorderly conduct, and had complained to friends of hearing voices and "vibrations sent to his body" by a "microwave machine," sources told ABC News following the mass shooting. But none of the warning signs were apparently passed on to Navy officials.
"So the challenge for law enforcement authorities broadly has been to better understand the behavioral characteristics of individuals who may be preparing to conduct an attack and take steps prior to an attack to prevent it from occurring," Cohen said. "And as with law enforcement broadly, the military has had to start considering these types of techniques as well, and that means applying those same strategies to active duty military and others who may have access to a military installation."
External threats remain major concern
But even as military officials turned to looking into ferreting out people in their ranks exhibiting troubling behavior, a fatal shooting at Naval Station Norfolk in Virginia proved external threats remain a major concern.
On March 24, 2014, truck driver Jeffrey Tyrone Savage, 35, who did not have access to the Norfolk base, was able to drive his rig onto the sprawling compound and walk aboard the USS Mahan, which was docked there, authorities said. Once aboard the destroyer, Savage was confronted by an armed petty officer, but he managed to wrest the gun away from her and fatally shoot Master-at-Arms 2nd Class Mark Mayo, who attempted to intervene, officials said. Savage was killed by Navy security officers aboard the vessel, officials said.
In the wake of the Norfolk shooting, an investigation by the Navy found numerous lapses in security that led to disciplinary action being taken against six people, including the commanding officer of Naval Station Norfolk and three civilian police officer the Navy had outsourced to guard the gate Savage drove through. The investigation found that one of the civilian police officers failed to check if Savage had an access pass to the base and waved him through the gate thinking he was going to make a U-turn and exit the installation, and then waiting nine minutes without alerting anyone before going to look for Savage.
"There was a time when security at U.S. military bases was completely done by the military. A lot of that has been ... outsourced if you will not just to private security companies at the gates but also with first responders coming from the local community," said Michael "Mick" Mulroy, a former U.S. deputy assistant secretary of defense and an ABC News contributor.
Mulroy -- co-founder of the Lobo Institute, which provides consulting and teaching on current and future military conflicts -- said the outsourcing of military base security has been prompted, in part, by military budget cuts.
When it comes to insider threats, Cohen said the military may have more flexibility to look for warning signs in military personnel than regular law enforcement would have with civilians due to privacy laws.
"If you're in the military and I think that you're in a mental health crisis and I have concern that that crisis could lead to you engaging in violent behavior, I have a lot more ability to direct you into certain types of support services as opposed to you being just a member of the general public," Cohen said. "In some respects, the military may be better suited in employing threat assessment and threat management strategies as a way to prevent attacks.
"But like the rest of society, we have not adapted our approach to preventing mass casualty attacks to fully take into account how the threat has evolved."
ABC News' Josh Margolin, Pierre Thomas and Luis Martinez contributed to this report.