Dylann Roof pleaded guilty April 10 in the state court trial, avoiding a second death-penalty trial. In January, a federal court sentenced Roof to the death penalty for killing nine black parishioners at the Mother Emanuel Church in Charleston, S.C., in 2015. (Gillian Brockell,Monica Akhtar,Bastien Inzaurralde/The Washington Post)

Dylann Storm Roof, the high school drop out and white supremacist who shot and killed nine black parishioners at a historic Charleston church in 2015, pleaded guilty Monday to state charges stemming from the massacre as part of a deal with prosecutors to spend the rest of his life in prison to avoid a second death-penalty trial.

Roof, now 23, wearing a striped jail jumpsuit, told a judge repeatedly he understood what he was admitting and that he was giving up his right to a trial freely and voluntarily.

“How do you wish to plead?” Judge J.C. Nicholson asked.

“Guilty,” Roof said. He declined a later opportunity to address the court, after friends and family members of his victims spoke.

The hearing lasted nearly an hour and a half, with the loved ones of victims talking about their struggle to recover from the loss Roof had inflicted, and Roof’s grandfather speaking on behalf of his grandson. Nicholson ultimately imposed nine life sentences plus 90 years.

Joe Roof, the grandfather of Charleston church shooter Dylann Roof, spoke during a state trial on Monday, April 10, telling the judge, "Dylann is not all bad." He also apologized for what happened and said it had ruined their lives. (Reuters)

Roof already had been sentenced to die earlier this year after for his convictions in federal court on hate crimes charges, though the state could have pursued a second such penalty in its murder case against the young man. Roof was charged both federally and at the state level after the June 2015 massacre at Emanuel African Methodist Episcopal Church, when nine black parishioners were shot and killed down during an evening Bible study.

Instead of pursuing their case after the federal one, prosecutors agreed to a deal in which Roof would plead guilty to nine counts of murder, three counts of attempted murder and a related weapons count and face a guaranteed sentence of life in prison without parole.

In a letter to relatives of the victims, Scarlett A. Wilson, the prosecutor overseeing Roof’s case in state court, told them that her goal was “to provide an insurance policy to the federal conviction and sentence,” and she suggested an added benefit was they they would no longer have to participate in more trials.

“The most effective way to do that is to secure a guilty plea for a life sentence and get [Roof] into federal custody,” Wilson wrote.

In court, Wilson gave a brief account of how Roof gunned down churchgoers who had invited him into their Bible study. “His plan was to kill specifically innocent African Americans, and his hope was to start a race war,” Wilson said. Roof said he agreed with Wilson’s description of his crimes.

Roof had made no effort to contest his guilt during the federal hate-crimes trial. Authorities said that before the attack, he posted a racist manifesto online filled with racial and anti-Semitic diatribes. During the federal trial, prosecutors said he was attempting to start a race war with the church massacre, and they played both his videotaped confession and presented as evidence Roof’s jailhouse journal.

“I would like to make it crystal clear, I do not regret what I did,” Roof wrote in the journal. “I am not sorry. I have not shed a tear for the innocent people I killed.”

Joe Roof, Dylann Roof’s grandfather, told the court Monday that his family had be “been distressed and just sick over what has happened to these families,” but he was still “aching” to hug his grandson.”

“Nothing is all bad, and Dylann is not all bad,” he said. He apologized for what had happened, and said he could not explain it.

“What happened here, I will never understand,” Joe Roof said.

Joe Roof’s testimony followed that of several victims’ loved ones and family members. Rev. Eric Manning of the Emanuel African Methodist Episcopal Church told the court that his church and its members “have paid a dear and deep price” but he hoped that “the resiliency which has been shown will continue to inspire not only the church members, not only the survivors, not only the families, but we would pray the entire state, country and world.”

Roof was quickly convicted on each of the 33 federal counts he faced and then sentenced to death by the same jury. But it remains unclear when or if the federal government will be able to execute him, given the rarity of federal executions and the ongoing shortage of lethal-injection drugs.

Wilson said she believed Roof was “more likely” to be executed in the federal system now because of the change in presidential administrations, and that South Carolina might not have been able to carry out the penalty because of the drug shortage.