Estimates of the percentage of mass shooters who are mentally ill vary widely, as both “mass shooting” and “mental illness” can be difficult to define. One recent analysis of murderers who killed or intended to kill four or more people found that 22 percent of male killers exhibited evidence of mental illness (the share was higher among women, but the sample was much smaller). Another analysis, by the group Everytown For Gun Safety, found that in about 11 percent of shootings between January 2009 and July 2015 in which four or more people were killed, concerns about the killer’s mental health had been reported to a doctor or other authority before the crime took place.

Under federal law, people who have been involuntarily committed because of mental illness are prohibited from buying guns. The federal government relies on the states to submit records of such commitments to the National Instant Criminal Background Check System, so that would-be gun buyers who have been committed will fail a background check.

In recent years, many more states have made an effort to submit such records to the federal system; the number in the databank has more than doubled since the 2012 mass shooting at a school in Newtown, Conn. After Connecticut began submitting its records in 2007, violent crime among people with disqualifying hospitalizations declined. However, getting state records is still a problem; six states have submitted fewer than 100 records.

A few states have additional prohibitions for those who have been hospitalized but not committed. California, for instance, bars those who have been involuntarily hospitalized for a short time from owning guns for five years, even if they were not committed. For people with severe mental illness who are never hospitalized, tighter gun permitting rules could help. Requiring an in-person application (like getting a driver’s license) would make it harder for them to qualify for gun ownership. In the 10 years after Connecticut passed a “permit to purchase” law requiring would-be gun buyers to pass a background check and complete a gun safety course with a certified instructor, gun homicides in the state fell by 40 percent.

In some states, the police may confiscate guns from people at risk of harming themselves or others, some of whom may be mentally ill. Between 1999 and 2009, 11 percent of confiscation warrants in Connecticut, for example, were requested as a result of “mental instability” on the part of the gun owner; by far the largest share, 46 percent, were requested because the owner showed signs of being suicidal.