Convicted Charleston church gunman Dylann Roof has been given nine consecutive life sentences after he pleaded guilty to state murder charges.
The death sentence received at his federal trial still stands.
Judge JC Nicholson imposed the state sentences following a hearing in which church members and Roof's grandfather testified about the personal toll of the case.
The self-avowed white supremacist entered his guilty pleas while standing at the defence table with his lawyers.
Roof's plea deal with state prosecutors, who had also been pursuing the death penalty, came in exchange for a life prison sentence on the state charges.
Solicitor Scarlett Wilson called the plea deal "an insurance policy for the federal conviction". With a new administration in Washington, Ms Wilson said she was more confident that a federal death sentence will be carried out.
Ms Wilson also praised the Charleston community for rising above the tragedy and called Roof's plan to start a race war "an epic failure".
Before sentencing Roof, Judge Nicholson heard members of historically black Emanuel AME Church describe the toll the June 2015 shooting took on them and their community.
"The impact at Mother Emanuel has been far reaching," said Pastor Eric Manning, who currently leads Emanuel's congregation. "We visit the crime scene every day."
Blondelle Gadsden, sister of killed Myra Thompson, said: "Even though we're at a point where death has been the sentence for him, my heart still goes out to him in hopes that he would repent to save himself from himself.
"I can't think of anything worse that he could do at this point than to not accept Christ and try to make his days on this earth a little bit more peaceful."
But Eva Dilligard, whose sister Susie Jackson was killed by Roof, said: "I think somebody doing something like that, he should get death... I'm very sorry. I'm a child of God. But he hurt the entire family."
The judge also heard from Roof's grandfather, Columbia lawyer Joe Roof.
"I want everyone to understand that nothing is all bad, and Dylann is not all bad," Mr Roof said. He added that he and his wife pray for the Emanuel families every night, and are sensitive to their problems.
"We have been distressed and just sick over what has happened to these families," the grandfather said.
Dylann Roof had been unapologetic at his federal trial as he listened to days of testimony from survivors. They described in harrowing detail the hail of bullets that began when parishioners prayed during a Bible study session.
After Monday's hearing, Roof, 23, will return to a local jail, while technically in the custody of the US Marshals Service, until he is transferred to a Bureau of Prisons facility "in short order," an official said.
Roof will be taken to a federal prison in another state, where he will await his execution on charges of hate crimes and obstruction of the practice of religion.
Roof was convicted late last year of 33 federal charges. He was sentenced to death during a separate proceeding earlier this year. Relatives of each of the nine people killed attended court each day of his federal trial.