The Texas Supreme Court dismissed four lawsuits filed by survivors and the families of those killed during a 2017 mass shooting at a church in Sutherland Springs, ruling Friday that the retailer who sold the rifle conducted the required background check on a dishonorably discharged Air Force member who later used it to gun down 26 people.  

Academy Sports + Outdoors cannot be sued in connection to the 2017 mass shooting under the federal Protection Lawful Commerce in Arms Act, which Congress passed in 2005 to protect firearm retailers and manufacturers from certain lawsuits seeking damages arising out of the criminal conduct of third parties, according to the opinion delivered Friday by Justice Debra H. Lehrmann. 

On Nov. 5, 2017, Devin Kelley entered First Baptist Church in Sutherland Springs wielding a Model 8500 Ruger AR-556 semi-automatic rifle fitted with a detachable 30-round magazine. He killed 26 people and injured 20 more, according to the Texas Supreme Court ruling. 

SUTHERLAND SPRINGS CHURCH HERO TO SPEAK AT VIRGINIA GUN RALLY: IT’S MORE ABOUT ‘CONTROL’ THAN SAFETY

Kelley had purchased the rifle, which was packaged with a 30-round magazine manufactured by Magpul Industries Corp., from an Academy store in San Antonio on April 7, 2016. As part of that sales transaction, Kelley purchased an additional Magpul 30-round magazine, sold separately. 

The ruling points out that Kelley reported a Colorado address and presented a Colorado ID when buying the rifle, prompting certain requirements imposed by the federal Gun Control Act on the sale of a firearm to an out-of-state resident. Academy "properly processed the required ATF Form 4473, which Kelley completed under penalty of perjury at the time of sale," Lehrmann wrote. 

Academy also ran the required background check on Kelley through the National Instant Criminal Background Check System, according to the ruling. 

"Although federal law disqualified Kelley from purchasing a firearm at the time of the sale – based in part on his conviction in a 2012 court-martial for assaulting his wife and stepson and his dishonorable discharge from the United States Air Force – that disqualifying information was not in the system, which authorized Academy to ‘Proceed’ with the sale," Lehrmann wrote. "Litigation against the Air Force for failing to collect, handle and report the required information is ongoing in federal court." 

Kelley had been found guilty of assaulting his wife and stepson and was dishonorably discharged from the service in 2012, but Air Force officials failed to report the conviction to the FBI background check system despite a requirement to do so.

PARKLAND SCHOOL SHOOTING PARENT TRICK EX-NRA PRESIDENT INTO FAKE HIGH SCHOOL GRADUATION SPEECH 

The survivors and families of those killed in the shooting had argued that under the federal Gun Control Act, the "sale, delivery and receipt" of the weapon must have fully complied with the laws of both Texas, the state of the sale, and Colorado, the state where the purchaser resided. 

Because Colorado law prohibits the sale or possession of magazines with a capacity of 15 rounds or more, they alleged that the package containing the rifle and magazines could not be legally sold in Colorado – and therefore the sale violated federal law. Lehrmann disagreed, ruling that the sale was legal because federal law applies only to the sale of firearms, not components, the Austin American-Statesman reported. 

After opening fire at the church, the gunman eventually killed himself following an armed confrontation with Stephen Willeford, who has been hailed as a hero and "good guy with a gun," according to the Houston Chronicle.  Willeford, a certified firearm instructor, reportedly heard gunshots from his nearby house, retrieved an AR-15 from his gun locker and ran toward the church, wounding Kelley in a brief shootout. 

Kelley hopped in his vehicle, and Willeford and another man chased him. Kelley shot himself with a handgun, authorities said. 

The shooting was decried as the worst in Texas history at the time. 

CLICK HERE TO GET THE FOX NEWS APP

Days after the shooting in 2017, U.S. Sen. John Cornyn, R-Texas, addressed the Senate on the need for legislation bolstering the National Instant Criminal Background Check System. He later introduced the Fix NICS Act, which was eventually signed into law and mandates that government agencies make plans for record submissions and penalizes agencies that do not comply, KWTX reported. 

Danielle Wallace is a Digital Reporter for Fox News and FOX Business. Follow her on Twitter at @danimwallace. If you've got a tip, you can email her at danielle.wallace@fox.com.