In the wake of massacres like Wednesday’s school shooting in Parkland, Fla., a small number of states have passed “red flag laws” that allow the seizure of guns before people can commit acts of violence.

California, Washington, Oregon, Indiana and Connecticut have statutes that can be used to temporarily take guns away from people whom a judge deems a threat to themselves or others. Lawmakers in 18 other states — including Florida — plus the District of Columbia have proposed similar measures. At the federal level, California lawmakers Rep. Salud Carbajal (D) and Sen. Dianne Feinstein (D) introduced legislation last May that would encourage states to adopt the approach.

Mental illness, escalating threats, substance abuse and domestic violence are among the circumstances in which a judge can order weapon restrictions under the laws.

“This morning I heard the sheriff [in Parkland] lament the fact that he did not have the tools to remove the firearms from the shooter,” Joshua Horwitz, executive director of the Coalition to Stop Gun Violence, said Thursday. “Had he lived in one of those states where this law is in place, he would have had the tools, and this shooting may have been averted.”