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 Roof, the self-described white supremacist sentenced to death earlier this year for the 2015 Charleston, S.C., church massacre, will plead guilty next month to murder charges in his state trial, attorneys said Friday.

The decision means that the Charleston community — including people who survived the church attack and relatives of those slain — will be spared a second death-penalty trial again poring over the details of the killings.

Roof was charged in two cases stemming from the June 2015 attack at Emanuel AME Church, when nine black parishioners were gunned down during Bible study. He has already been convicted on federal hate-crime charges and was still facing a state trial on charges of murder and attempted murder.

In a letter to families of the victims, Scarlett A. Wilson, the prosecutor overseeing Roof’s case in state court, told them that Roof, now 22, had agreed to plead guilty in exchange for a sentence of life in prison. Roof had been facing another possible death sentence in the state case.

Dylann Roof appearing via video link in court not long after the shooting. (Grace Beahm/European Pressphoto Agency)

“The plea is negotiated which means it is ‘carved in stone,’ ” Wilson wrote in the letter Friday, a copy of which was obtained by The Washington Post.

Wilson described this as “an insurance policy to the federal conviction and sentence,” writing that her goal was to get a guilty plea so that Roof could be moved into federal custody. Roof is being held in Charleston County’s detention center.

“A guilty plea in state court means that if something very, very, very unlikely were to happen at the federal level, the state sentence would take effect and he would serve life in prison,” she wrote. Wilson added, in parentheses: “And no more trials!”

Ashley Pennington, a defense attorney for Roof in the state case, confirmed that Wilson’s letter was accurate and declined to comment further.

This agreement signals an end to the lengthy court proceedings that have followed the massacre, dating to Roof’s first court appearance nearly two years ago. During that hearing, relatives of the church victims stood up and spoke of their pain while also offering Roof forgiveness and saying they were praying for his soul.

Authorities said that before the church attack, Roof had posted a racist manifesto on his website laden with racial and anti-Semitic diatribes. Federal prosecutors in his hate-crimes trial said Roof had “self-radicalized” online, taking on violent white-supremacist beliefs he read on the Internet, and carried out the attack to try to start a race war.

During the harrowing federal trial, prosecutors grimly recited the facts of the shooting: Parishioners gathered in the basement of the historic Mother Emanuel church welcomed in a young stranger who was given a Bible and a seat next to the Rev. Clementa Pinckney.

After the Bible study, the gunfire began. Felicia Sanders, one of the three people to survive the attack, testified during the opening day of the trial that she watched Roof — “evil, evil, evil as can be,” she said — pump five bullets into her son, Tywanza. Tears streaming down her face, Sanders recalled taking cover under a table, holding her 11-year-old granddaughter.

“I said, just be quiet, just play dead,” she said during her emotional testimony, which elicited sobs from the dozens of friends and family members in court. “I squeezed her face to my body so tight that I thought I suffocated her.”

Prosecutors also played Roof’s videotaped confession, which recorded him calmly explaining his desires to kill black people. At times, he chuckled while speaking to FBI agents.

“I had to do it because somebody had to do something,” Roof said during the two-hour interview. “Black people are killing white people every day on the street, and they are raping white women. What I did is so minuscule to what they’re doing to white people every day all the time.”

Roof had argued in a court filing it was “not fair” that prosecutors spent considerable time during the trial asking victims’ family members to relate their emotional stories. The jury was also told by prosecutors about Roof’s jailhouse journal, in which he wrote: “I would like to make it crystal clear, I do not regret what I did. I am not sorry. I have not shed a tear for the innocent people I killed.”

Jurors swiftly convicted Roof on each of the 33 counts he faced in his federal indictment, and the same jury needed little time deliberating before sentencing him to death.

However, it is unclear when — or if — the federal government will be able to carry out this sentence. Federal executions are rare, with only three since the federal death-penalty statute was reinstated in 1988 and expanded in 1994, and executions in general have declined nationwide because of a shortage of lethal injection drugs.

Had South Carolina obtained a death sentence for Roof, the state might not have had any more luck carrying out a death penalty. The state does not have any lethal injection drugs and does not appear likely to obtain them soon.

In her letter Friday, Wilson told relatives of Roof’s victims that he would formally plead at the Charleston County Courthouse on April 10 — a week after his 23rd birthday. Roof will be allowed to speak in court, as will relatives of his victims.

Before Roof was formally sentenced to death in January, some of those relatives gathered to address him, telling him that he failed in his mission to spark a race war.

“You didn’t accomplish anything but deep hurt for other people,” said Shirrene Goss, sister of Tywanza Sanders. “You’re going to realize you didn’t have to do this. It’s going to hit you hard and bring you to your knees.”

As he did throughout the trial, Roof refused to meet the eyes of anyone who spoke to him.

In another case related to the attack, Joey C. Meek, a friend of Roof’s who had stayed in the same trailer as him in the weeks before the massacre, was sentenced earlier this month to 27 months in prison for lying to the FBI and concealing his knowledge of what would happen. Meek had pleaded guilty last year.

Further reading:

Remembering the Charleston church shooting victims

Charleston church shooter: ‘I would like to make it crystal clear, I do not regret what I did’

This story, first published at 12:16 p.m., has been updated.