CNN  — 

The families of the nine people slaughtered in a South Carolina church in 2015 can sue the US government for negligence, an appeals court has ruled.

The survivors want to hold the government accountable that shooter Dylann Roof was able to buy the gun he used to open fire in an African-American church.

The US Circuit Court of Appeals overturned a lower court’s ruling that protected the government from liability under two federal laws.

Roof, an avowed white supremacist, was convicted of federal murder and hate crimes charges. He was sentenced to death in January 2017.

He said he felt he had no choice but to kill the worshipers at the Emanuel African Methodist Episcopal Church in June 2015.

Prosecutors cite Roof’s “racist hatred” and said he had showed no remorse.

Then-FBI Director James Comey said shortly after the shooting that Roof was prohibited under federal law from possessing a firearm and that he was only able to purchase the Glock 41 semiautomatic pistol he used because of lapses in the FBI’s National Instant Criminal Background Check System (NICS).

Roof had been arrested on a drug charge that would have blocked the gun sale had it been properly reported during the background check, the court found.

As such, Roof “should not have been allowed to purchase the gun he allegedly used that evening,” Comey said.

Victims’ families sued, alleging the government was negligent in its background check. If it had been performed properly, “no one disputes” it would have kept him from buying the gun, the appeals court wrote.