The city of New York, along with Philadelphia and San Francisco, is suing the Department of Defense, seeking to fix its "broken" system for reporting service members who are disqualified from buying and owning guns.
The Department of Defense is supposed to report to the FBI the names of service members convicted of crimes or dishonorably discharged from legally buying or possessing guns. The FBI maintains the national background check system for gun licensing and sales.
But, the cities contend, the Department of Defense has failed to report "significant numbers of disqualifying records" to the FBI for decades.
The lawsuit argues that the failure allowed the gunman in the Sutherland Springs, Texas, church shooting last month to pass a background check, buy an assault rifle and carry out the mass shooting there that left 26 people dead and nearly two dozen more wounded.
The Justice Department declined to comment on the lawsuit.
The Pentagon has long been aware of its failure to consistently give the information to the FBI. In 2015, the Pentagon inspector general flagged a 30 percent failure rate for submitting fingerprints and criminal case outcomes to the report, and the inspector general found in 1997 a higher rate of lapses.
A Pentagon spokesman on Tuesday said he couldn't comment specifically on the lawsuit.
"The department continues to work with the services as they review and refine their policies and procedures to ensure qualifying criminal history information is submitted to the FBI," said Tom Crosson, a Pentagon spokesman.
Sutherland Springs gunman Devin P. Kelley was convicted in a domestic violence case in 2012, when he was in the Air Force, and, under federal law, should not have been able to purchase a firearm, but his information was never added to the FBI database. Kelley killed himself after his deadly rampage in November.
Both the Defense Department and the Justice Department were reviewing the National Instant Criminal Background Check System after the shooting, NBC News reported last month.
The NYPD, along with the police departments in Philadelphia and San Francisco, rely on the FBI database to conduct background checks on gun permit applicants, monitor gun purchases and ensure seized guns are not returned to anyone prohibited from owning them
"For decades the Department of Defense has shirked its legal obligation to provide information to the FBI that may disqualify dangerous individuals from legally acquiring guns," said New York City Corporation Counsel Zachary W. Carter. "This lawsuit seeks a court order requiring the Department of Defense to fix a broken system that puts lives at risk."
Philadelphia Mayor Jim Kenney said in a statement that the city is joining the suit because the records are "absolutely critical" to its decisions on whether to grant someone a license to carry a firearm.
The City of New York, et al. v. The United States Department of Defense, et al. was filed in the U.S. District Court for the Eastern District of Virginia on Tuesday.