A California law designed to help police or family members keep guns out of the hands of at-risk individuals might have stopped the shooter who killed 12 people at a country and western bar.

After a mass shooting four years ago, the state passed a new law where courts could be asked to temporarily bar an at-risk person from owning guns.

Officer, art student, veteran: the victims of the California bar shooting Read more

The massacre in Thousand Oaks, California, has troubling parallels to the 2014 shooting, experts said, highlighting the fact that California’s three-year-old “gun violence restraining order” law is still rarely used.

Passed in the wake of the 2014 Isla Vista shooting, the new law was designed to close gaps in existing laws on mental health and violence – gaps that had allowed the Isla Vista shooter, Elliot Rodger, to legally own guns, despite a history of disturbing behavior that had alarmed his family and prompted a welfare check from law enforcement.

In both the Isla Vista and Thousand Oaks shootings, law enforcement officials had contact with the shooter before the attack, but had determined that they did not meet the criteria to be involuntarily detained for further mental health assessment.

The California “gun violence restraining order law”, which went into effect in 2016, was supposed to bridge the gap, giving law enforcement or family members tools to disarm someone showing signs of dangerous behavior, even if their behavior does not warrant immediate detention.

Play Video 2:17 California shooting: 'The last thing I said was: Son, I love you' – video report

“The idea of the gun violence restraining order is that you don’t have to wait until someone is immediately dangerous and threatening someone, if there are behavioral indications of risk. The idea is to intervene upstream,” said Jeff Swanson, a Duke University researcher and one of the nation’s leading experts on mental health and violence.

It’s an approach to gun violence prevention that has attracted increasing bipartisan support since the school shooting in Parkland, Florida, this February, which left 17 people dead. The 19-year-old Parkland shooter had a long history of troubled behavior and contact with law enforcement. The FBI received two separate warnings about threatening statements from the shooter, but failed to fully follow up on either.

Gun violence restraining orders, also known as “extreme risk protection orders”, are “meant to enable people who are most likely to know that someone is at risk of harming themselves or others to take action, to remove the most lethal form of harm for them,” Anderman said.

Pain for Parkland students after pro-gun candidates win: 'I'm shaking with anger' Read more

The laws only allow guns to be confiscated temporarily, provide ways for those targeted by the orders to contest them in court, and include penalties for anyone who tries to abuse the orders.

Since Parkland, eight states, including Florida, have passed new versions of these laws. Five of these bills were signed by Republican governors. The Trump White House has endorsed the policy, encouraging more states to pass these laws at the state level.

But experts say enforcement of the landmark law has lagged in California, and many people are still unaware that it exists.

“There are a lot of law enforcement officers in this state who have never heard of the gun violence restraining order,” said Allison Anderman, the managing attorney at the Giffords Law Center to Prevent Gun Violence, who is working to improve implementation of the law.

“There’s nothing at the state level that I’m aware of that requires officers to be trained in this law.”

In 2014, prompted by concern from his parents and counselor over disturbing videos he had posted online, deputies from the Santa Barbara sheriff’s office visited 22-year-old Rodger, but found him “calm, shy and polite”. Rodger told them his mother was a “worry wart”.

Facebook Twitter Pinterest A woman waits for news about a missing loved one after the shooting in Thousand Oaks. Photograph: Kent Nishimura/LA Times via Getty Images

A month later, he stabbed three of his room-mates to death and then went on a shooting spree across the university town of Isla Vista, including targeting a sorority.

When sheriff’s deputies visited the home of the Thousand Oaks shooter, 28-year-old Ian David Long, this April, they found him “somewhat irate” and “acting a little irrationally”, but determined he did not meet the criteria to be involuntarily detained for further mental health assessment, the Ventura county sheriff, Geoff Dean, said on Thursday.

Long opened fire at a Thousand Oaks bar popular with college students on Wednesday night, leaving 12 people dead, including a 25-year veteran of the sheriff’s department. He used a 45-caliber Glock handgun that had been purchased legally, the sheriff said.

Play Video 0:45 'Guys, run, go': man films as California gunman opens fire in bar – video

Long was known among his neighbors for breaking things and kicking holes in the walls of the home he shared with his mother, the Los Angeles Times reported.

“They talked about how there was all this anger, but he didn’t fit the criteria for an involuntary commitment. That is the sweet spot for where we think this tool should be used,” said Christian Heyne, the legislative director for the Coalition to Stop Gun Violence, an advocacy group that has been at the forefront of pushing for gun violence restraining orders across the country.

While it was too early to make definitive statements about what role a gun violence restraining order might have been played in preventing the Thousand Oaks shooting, Heyne said: “There are a lot of places in California that are in desperate need for law enforcement to be trained, not only on the mechanism itself and how it works, but where it can be useful, what sort of gaps this can fill.”

Some efforts to improve training were already under way, he said, including one led by the San Diego city attorney’s office.

An investigation by the Sacramento Bee found that California courts had issued gun violence restraining orders fewer than 200 times in the first two years after the law went into effect.

In press conferences on Thursday, the Ventura county sheriff’s office made no mention of a gun violence restraining order related to Long’s case. A spokesman for the sheriff’s did not immediately respond to requests for comment on whether law enforcement officials there had sought a gun violence restraining order for Long, or whether there had been any discussion of pursuing an order.

In Ventura county, California courts issued just one gun violence restraining order in 2016, and three in 2017, according to the Sacramento Bee investigation.

“What happened in this situation – why law enforcement didn’t take the step to get a gun violence restraining order after this individual was not committed – is I think something that we’re all waiting to hear about,” Anderman said.