Barely four years before a gunman’s deadly rampage in Maine, a state that is staunchly protective of gun rights, the governor signed a law aimed at preventing a mass shooting like the one Wednesday night that claimed at least 18 lives.

It was called a “yellow flag” law, different from the “red flag” laws cropping up in other states to seize weapons from gun owners viewed as a threat. In a sign of the pro-Second Amendment mindset in Maine, a gun-rights group helped write the law, and critics said that, while it was a first step toward stronger gun safety measures, the state could save more lives by doing more — like passing a red flag law.

The yellow flag law and permissive gun measures in Maine are coming under greater scrutiny in the aftermath of a massacre that authorities say was carried out by a man who was committed to a mental health facility for two weeks this past summer and had reported “hearing voices and threats to shoot up” a military base.