Survivors of the mass shooting inside a Charleston, South Carolina, church in 2015 should be allowed to sue the federal government for failing to enforce national background checks on gun purchases, an appellate court ruled Friday.

A lower court had dismissed the case, which was filed by survivors and the family members of victims of the attack on Mother Emanuel AME Church, carried out by Dylann Roof on June 17, 2015.

But the U.S. Court of Appeals for the 4th Circuit concluded that the lower court judge was wrong, and revived the case Friday. The 4th Circuit's ruling could also be appealed.

The federal government wrongly cited law protecting individual federal employees from civil action as its reason to dismiss the lawsuit, the court ruled.

Plaintiffs said that if federal guidelines had been properly enforced, Roof should not have been able to purchase the gun he used to kill nine people and wound three others.

Roof had a drug offense from February 2015 that, plaintiffs said, should have made him unable to buy the murder weapon under federal statutes.

Roof, 25, an admitted white supremacist, was found guilty of all charges in December 2016 and sentenced to death. He is being housed at the high-security U.S. Penitentiary in Terre Haute, Indiana.