WASHINGTON -- Families of nine victims killed in a racist attack at a Black South Carolina church have reached a settlement with the Justice Department over a faulty background check that allowed Dylann Roof to purchase the gun he used in the 2015 massacre.

The Justice Department will pay US$88 million, which includes $63 million for the families of the nine people killed and $25 million for five survivors who were inside the church at the time of the shooting, it was announced Thursday.

Bakari Sellers, an attorney who helped broker the agreement, told The Associated Press the "88" figure was purposeful. It's a number typically associated with white supremacy and the number of bullets Roof said he had taken with him to the attack.

"We've given a big `F you' to white supremacy and racism," Sellers told the AP. "We're doing that by building generational wealth in these Black communities, from one of the most horrific race crimes in the country."

According to the Justice Department, settlements for the families of those killed range from $6 million to $7.5 million per claimant. Survivors' settlements are $5 million per claimant.

Months before the June 17, 2015 church shooting, Roof was arrested on Feb. 28 by Columbia, South Carolina police on the drug possession charge. But a series of clerical errors and missteps allowed Roof to buy the handgun he later used in the massacre.

The errors included wrongly listing the sheriff's office as the arresting agency in the drug case, according to court documents. An examiner with the National Instant Criminal Background Check System found some information on the arrest but needed more to deny the sale, so she sent a fax to a sheriff's office. The sheriff's office responded it didn't have the report, directing her to the Columbia police.

Under the system's operating procedures, the examiner was directed to a federal listing of law enforcement agencies, but Columbia police did not appear on the list. After trying the separate West Columbia Police Department and being told it was the wrong agency, the examiner did nothing more.

After a three-day waiting period, Roof went back to a West Columbia store to pick up the handgun.

The lawsuit for a time was thrown out, with a judge writing that an examiner followed procedures but also blasting the federal government for what he called its "abysmally poor policy choices" in how it runs the national database for firearm background checks. The suit was subsequently reinstated by a federal appeals court.

The mass shooting at Mother Emanuel AME Church was a horrific hate crime that caused immeasurable suffering for the families of the victims and the survivors," Attorney General Merrick Garland said in a statement. "Since the day of the shooting, the Justice Department has sought to bring justice to the community, first by a successful hate crime prosecution and today by settling civil claims."

In 2017, Roof became the first person in the U.S. sentenced to death for a federal hate crime. Authorities have said Roof opened fire during the Bible study at the church, raining down dozens of bullets on those assembled. He was 21 at the time.

The slain included the Rev. Clementa Pinckney, pastor of the AME Emanuel Church, a state senator, as well as other pillars of the community. They all shared deep devotion to the church, known as Mother Emanuel, and passed that faith along to their families, many of whom offered Roof forgiveness when he appeared in court just days after the attack.

The FBI has acknowledged that Roof's drug possession arrest should have prevented him from buying a gun.

Speaking with AP in Washington ahead of the news conference, Pinckney's eldest daughter recalled the night of the shooting and said she was committed to maintaining the legacy of her father, who died when she was 11.

"I've done whatever I can to keep his memory alive and to carry on his legacy throughout my life," Eliana Pinckney, 17, told the AP. "Just to make sure that the memories that I have with him can be shared with other people, so that other people are inspired by the life that he lived, and the life that he would keep living if he was still here."

The deal, which was reached earlier this month, is still pending a judge's approval, Sellers said.

"All nine of these families have been so strong, and they deserve this closure," Sellers said. "Of course we wanted more, but this is just, and this is justice, and finally, these families can say that they got it."

Correction:

This story has been corrected to show the age of the pastor's daughter is 17, not 11.