ON OCTOBER 25, as New Englanders tuned in to watch the Celtics tip off their NBA season against the Knicks, many of us were switching to the news or glued to our phones wondering if a friend or loved one could’ve been bowling or dining in Lewiston, Maine, as a gunman attacked two establishments that evening, killing 18 people and wounding over a dozen more.

On an otherwise typical Wednesday night, an horrific act broke the peace, shattered lives, and tore a community apart. As the perpetrator remained at large and reports echoed across the country, people began to ask who the shooter was, and what could have led him to commit this terrible act. In time, we learned of his military service, and more tragically of his recent mental health struggles, erratic behavior, and the many missed opportunities for him to receive the care and help he needed. We also learned that gaps in the country’s and Maine’s gun safety laws, as well failures to use the tools available, allowed him access to the deadly assault weapon he used to kill 18 people in a matter of minutes.

It’s clear now that there were many warning signs in the months leading up to the shooting that the shooter was a danger to the community and to himself, and many policy failures that allowed him to keep access to military-grade, semi-automatic rifles. While we can never go back in time, we can look forward and attempt to adopt and implement laws and policies that we know can help prevent future tragedies.

I spent more than a decade enlisted in the Marine Corps. Through hundreds of hours training on and operating all types of weapons platforms, I first and repeatedly learned how to safely operate each one. Before I was provided a single round of live ammunition, I knew the inside and outside of the weapon. After a tour in Iraq, I had an intimate relationship with military-grade weapons, and I knew then and still believe they have no place on our streets.

When it comes to guns in New England, laws can vary from state to state. Here in Massachusetts, we have a longstanding tradition of strong gun safety laws. If Maine had an Extreme Risk law similar to Massachusetts’, the shooter’s family would have been able to directly petition a court to temporarily restrict his access to firearms. Of course Massachusetts isn’t perfect, either.

Sadly, patterns of gun violence tend to evolve, and laws must keep up. Massachusetts has fallen behind New Jersey, Maryland and Florida in how well it is utilizing its Red Flag law, and we must further strengthen our limits on assault weapons to ensure we are keeping communities safe. In addition, the Commonwealth needs to finally address untraceable “ghost guns” that have become the weapon of choice for many criminals and White supremacists. Last month, the Massachusetts House of Representatives passed comprehensive legislation that would take common-sense steps to fill these gaps and the Senate must follow suit.

Our federal lawmakers also have work to do: it’s long past time for Congress to reinstate a federal ban on assault weapons. They should also oppose the Kennedy Amendment, a proposal under consideration that would undermine our federal background check system by prohibiting the Department of Veteran Affairs from sharing information that is critical to protecting veterans who are at risk of harming themselves or others.

It’s clear, now more than ever, that no place in this country is immune to gun violence. In the military, I was taught to survey the battlefield, assess the enemy, and act in accordance with the best interests of my Marines in my charge, the rules of engagement, and the local civilian population. Looking across the landscape of New England, there are clearly visible ways to protect our communities and stem the tide of senseless acts of gun violence, while still promoting safe and responsible gun ownership.

Sean Horgan is a Marine Corps veteran who served in Iraq as a staff sergeant in a machine-gun platoon. A gun owner, he lives in Greater Boston with his wife and children.