A 24-year-old man with dozens of guns threatened to kill everyone at his family’s business. A 14-year-old boy whose dad had a rifle and pistol made Instagram posts praising school shootings. A 48-year-old suicidal ex-cop whose coworkers felt threatened by him had shotguns at home.

All were disarmed under California’s “red flag” law, the first of its kind in the country, according to a study by University of California-Davis medical school researchers published Monday in the Annals of Internal Medicine.

The study, the first academic research on the law’s effectiveness since it was enacted in 2016, examined 21 cases in which gun violence restraining orders were obtained through the courts because of potential mass shooting threats. The study found no subsequent indication of violence involving the subjects of the gun-seizure orders.

As recent mass shootings in Gilroy, El Paso, Texas, and Dayton, Ohio, this summer raise interest in expanding such laws nationwide, the study of 21 cases in which California’s law was used to seize weapons from people exhibiting threatening behavior suggests it may have helped reduce rampage shootings and other gun deaths.

“The situation here is that in each case, risk was judged unacceptably high, an intervention was taken, often firearms were taken and there was no bad outcome,” said lead author Garen Wintemute, a doctor who heads a violence prevention program at UC Davis. “So if somebody was to ask me, ‘Should people be using these orders if they’re available?’ I’d say, ‘Absolutely.'”

California adopted its Gun Violence Restraining Order law after a disturbed 22-year-old man stabbed three men to death in his apartment and fatally shot two women and a man in a 2014 Isla Vista rampage before killing himself in a shootout with police.

Weeks before, his parents, alarmed over his worsening behavior and online posts, had urged police to intervene. But officers left him alone after he told them it was a misunderstanding.

The law, modeled after domestic violence restraining orders, allows police or family members to obtain a judge’s order to disarm a gun owner they fear will turn violent. The order requires the gun owner to surrender all firearms for 21 days, and can be extended to a full year after a hearing.

Two other states, Connecticut and Indiana, had extreme risk firearm safety warrant laws empowering police to seize guns based on information that a person was a risk to himself or others, but California was the first to allow family members to seek such warrants as well.

Fifteen states and the District of Columbia have since adopted similar laws. A bill by Assemblyman Phil Ting, D-San Francisco, would allow school employees and coworkers to also petition for such orders.

Gun-rights advocates have raised concerns about due process and potential for abuse, although a California law makes it a misdemeanor to seek such an order under false pretense.

The National Rifle Association Institute for Legislative Action has argued that such laws allow authorities to seize a person’s lawfully owned weapons for weeks without a hearing and the opportunity to present evidence on their behalf.

“Someone could be stripped of their Second Amendment rights without due process, without being taken into custody for any criminal offense or without being required to undergo evaluation for treatment by a mental health professional,” the NRA-ILA said in opposing Texas red-flag bills.

According to Ting’s office, California Gun Violence Restraining Orders have been issued 614 times from 2016 to the end of 2018, with most of those — 424 — issued last year.

The UC Davis researchers had requested records of 414 cases from 2016-2018 registered with the state Justice Department and received 159. Wintemute said they expected most to involve suicidal gun owners but were surprised to encounter a significant number involving threats of mass shootings and decided to take a closer look at those.

The researchers conducted Google searches to look for indications that the subjects of those gun removal orders had since done something violent, and did not find any.

The researchers did not identify the subjects of the gun removal orders, the cities or counties where they lived or the dates they were issued.

Seven of the surveyed cases involved threats of workplace violence, five involved threats against schools or children, four involved gun owners with significant medical or mental health issues and five involved threats of politically motivated violence.

The subjects of the gun removal orders ranged in age from 14 to 65, and two of them were women. A judge agreed to extend the gun removal order in 14 of the 15 cases in which it was requested after a hearing.

In one case, the 47-year-old mother of a young man shot and killed by police stated repeatedly at a public hearing that she would kill police officers because police had killed her son. State records indicated the woman owned four handguns but she denied having any. A judge denied a petition for extending the order after a hearing. Wintemute said they did not have further information explaining the decision.

In another case, a 62-year-old woman reportedly threatened five kids between 11 and 15 with a gun. She denied pointing a firearm at them, the study said, but police took a revolver from her home after she threatened she wanted to go to their homes and “finish off each one of them.” A judge extended the order for a year after a hearing.

In several cases, police did not find firearms to remove, and in three cases, the subjects of the gun removal orders had pending purchases blocked by police because of California’s 10-day waiting period on firearm purchases.

Fifty-two firearms were recovered in the 21 cases studied, 26 of the weapons in just one case involving the 24-year-old man who had threatened his family’s business.

In the case of the 14-year-old boy, police confiscated a 9mm semiautomatic pistol and a .30-caliber rifle that his father owned after the boy was taken into custody for an emergency psychiatric evaluation. A school administrator told police that the boy had posted videos of himself on Instagram using firearms and commenting on school shootings. A followup investigation found he researched firearms and searched for “white power” on a school computer.

The ex-cop case involved an officer who had attempted suicide unsuccessfully at department headquarters, blaming alleged workplace mistreatment, the study said. The officer had access to shotguns belonging to a member of his household, and they were removed under the order.

There were also cases involving alleged terrorism threats.

Wintemute cautioned that the study has its limitations — they cannot say what would have happened had an order to seize the guns not been issued.

“We’re really careful about discussing effectiveness,” Wintemute said. “What we know is that threats were made and there was concerning behavior, orders were issued … and the threatened events didn’t occur.”