Judges can consider an individual’s history of domestic abuse, for example, under red-flag laws adopted in at least 17 states. Such laws allow courts to issue a special type of protective order under which the police can take guns, temporarily, from people deemed dangerous.

The National Rifle Association, the nation’s largest gun lobby, has opposed efforts to expand the situations in which individuals accused of abuse can lose the right to own guns, saying that doing so would deny people due process and punish people for behavior that is not violent.

But Allison Anderman, senior counsel at Giffords Law Center to Prevent Gun Violence, said measures that facilitate the removal of guns from abusers “are a critical step in saving the lives of abuse survivors.” And given the link between domestic abuse and mass shootings, she said, these laws may also help prevent massacres.

The plagues of domestic violence and mass shootings in the United States are closely intertwined. The University of Texas tower massacre in 1966, generally considered to be the beginning of the era of modern mass shootings in America, began with the gunman killing his mother and wife the night before.

Devin P. Kelley, who opened fire on parishioners at a Sunday service in Sutherland Springs, on Nov. 5, 2017, had been convicted of domestic violence by an Air Force general court-martial, for repeatedly beating his first wife and breaking the skull of his infant stepson. That conviction should have kept him from buying or owning guns, but the Air Force failed to enter the court-martial into a federal database.

In attacking the church, Mr. Kelley appeared to be targeting the family of his second wife.

In a case that highlights the so-called boyfriend loophole, in 2016, a man who had been convicted of stalking a girlfriend and had been arrested on a charge of battery against a household member shot Cheryl Mascareñas, whom he had briefly dated, and her three children, killing the children. Because the man had not been married to or had children with the woman he was convicted of stalking, his conviction did not prevent him from having or purchasing guns.