Texas authorities believe domestic violence may have been at the root of Devin Kelley’s murderous rampage in a church near San Antonio on Sunday, and the military now concedes that its failure to enter details of a previous domestic violence conviction may have made it easier for him to obtain the assault rifle he used to kill 26 people. But before we conclude that the simple issue here is a failure to enforce existing gun laws, we should bear in mind that where domestic violence is concerned, federal restrictions on gun sales contain enormous loopholes that put millions of women at risk every year.

In the 1990s, Congress passed laws prohibiting those convicted of domestic violence misdemeanors and those subject to permanent restraining orders from buying guns — but its definition of an “intimate partner” only includes a spouse, a co-habitant or someone with whom the perpetrator shares a child. That leaves what anti-domestic violence advocates call the “boyfriend loophole,” the “stalker loophole,” the “temporary restraining order loophole” and the “relinquishment loophole.” In all four cases, the law not only fails to protect everyone it could but actually misses those who might be most vulnerable.

Decades ago, domestic homicides were overwhelmingly committed by spouses, but that is no longer true. According to the most recent information from the Bureau of Justice Statistics, such killings are now more commonly committed by non-married partners. Stalking is typically charged as a misdemeanor, so it doesn’t automatically lead to a federal prohibition on buying a gun. The Center for American Progress scrutinized conviction records in 20 states and found nearly 12,000 people who had been convicted of misdemeanor stalking who had guns, but according to the National Institute of Justice, fully 90 percent of victims of murder or attempted murder by a partner had previously been stalked. Temporary restraining orders are typically the first step in the process for women seeking protection from abusers, and it is during the period when they first are in effect that the women are likely most at risk. A 2010 report in the Journal of the American Academy of Psychiatry and the Law summarized multiple studies showing that it is in the early stages of such protection that such orders tend to be violated and that women report additional abuse. And finally, the federal law prohibits those convicted of domestic violence from owning guns, but it includes no explicit requirement that they actually turn over any guns they already have. Some states (including Maryland, in certain circumstances) do require the relinquishment of guns by domestic abusers and the subjects of restraining orders, and Boston University researchers found a drop of nearly 15 percent in intimate-partner gun homicides in those states.

This spring, Maryland Rep. Anthony G. Brown introduced legislation of his own to close the boyfriend, stalker and temporary restraining order loopholes, and he has a powerful story to tell. In 2008, his cousin, Catherine Brown, a first-grade teacher, broke up with her boyfriend, Michael K. Wilson. She told her Montgomery County neighbors that she was afraid of him and asked them to call the police if they saw his car. That August, he showed up at her house, confronted her and forced her into her garage. The police arrived, but he shot and killed her before officers killed him. As lieutenant governor during the O’Malley administration, Mr. Brown successfully pushed for state-level initiatives to close those loopholes, among a host of bills to help protect and support domestic violence victims.

Despite the Texas shootings, replicating that on the federal level will be difficult if not impossible. Democrats in Congress have made several attempts over the years to close those loopholes only to see them blocked by the NRA, which called 2015 legislation by Minnesota Sen. Amy Klobuchar an attempt to “manipulate emotionally compelling issues such as ‘domestic violence’?” as part of an anti-gun agenda. If anything, NRA supporters are emboldened by the Texas shootings because Stephen Willeford, a man who lives next to the Southerland Springs First Baptist Church — a former NRA instructor, no less — heard the shots, retrieved his own AR-15-syle rifle and opened fire on Kelley, hitting him twice. Texas’ Attorney General Ken Paxton went so far as to argue that the killings make the case for “at least arming some of the parishioners so they can respond to something like this.” President Donald Trump claims stricter gun laws would have made the death toll worse.

But even in the unlikely event that Mr. Willeford’s action saved “hundreds” of lives, as President Trump says, his role in stopping a mass shooting was an aberration. The fact that the killings were perpetrated by a domestic abuser was not. Domestic violence is a common thread among mass shooters — Everytown for Gun Safety found a link to domestic or family violence in more than half of mass shootings from 2009-2016 — and in thousands more cases that don’t make international headlines, it reveals an increased likelihood that a woman will be killed. A woman doesn’t have to have been married to an abuser, have a child with him or live with him for her life to be at risk. All it takes is a gun.