Of all the wrenching similarities between the massacres at Marjory Stoneman Douglas High School in Parkland, Florida, the Tree of Life synagogue in Pittsburgh, the Walmart in El Paso, Texas, and the Tops supermarket in Buffalo, New York, one stands out most starkly: Each gun used was purchased legally.

From 1966 to 2019, 77% of mass shooters obtained the weapons they used in their crimes through legal purchases, according to a comprehensive survey of law enforcement data, academic papers and news accounts compiled by the National Institute of Justice, the research wing of the Justice Department.

In upstate New York a few months ago, the 18-year-old suspect in the Buffalo shooting walked into Vintage Firearms in sleepy Endicott, passed an instant background check without a glitch and bought a used Bushmaster XM-15 semi-automatic rifle, a copy of the ubiquitous AR-15 used in many other mass shootings.