Convicted Charleston church shooter Dylann Roof pleaded guilty to state murder charges Monday, leaving him to await execution in a federal prison and sparing his victims and their families the burden of a second trial.

The self-avowed white supremacist was given nine life sentences, marking the end of his court cases. He stood at the defense table with his attorneys, clad in a gray and white striped jail jumpsuit and handcuffed to a chain at his waist.

Roof was unapologetic at his federal trial in December and January as he listened to days of testimony from survivors. They described in harrowing detail the hail of bullets that began when parishioners closed their eyes to pray during a June 2015 Bible study at the historically black Emanuel AME Church.

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”, a law enforcement official with knowledge of the case told the Associated Press.

The official spoke on condition of anonymity because he was not authorized to speak publicly about the case.

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.

The deal with state prosecutors, who also had been pursuing the death penalty, comes in exchange for a life prison sentence on the state charges.

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. Some testified with emotion about the voids left by the losses of their loved ones.

Survivors of the shooting also spoke in court during the trial, evoking chilling images of the murders. Jennifer Pinckney, the widow of slain pastor and state Senator Clementa Pinckney, brought some jurors to tears with her description of how she shielded her young daughter in her husband’s office as the bullets rang out in the nearby fellowship hall.

During his federal trial, Roof was placid and, at times, unapologetic. Twice found competent to stand trial, Roof fired his defense team for the sentencing portion of his proceedings, calling no witnesses or putting up any evidence of his own.

“I have the right to ask you to give me a life sentence, but I’m not sure what good it would do anyway,” Roof told jurors in his closing argument. “I still feel like I had to do it.”

Through their attorneys, some relatives and survivors spoke out when the state plea arrangement was announced by prosecutors last month. Charleston attorney Andy Savage, who represents several of the families, said the arrangement to transfer Roof to a federal institution and away from Charleston “is the preference of all victims that I represent”.

Savage said Felicia Sanders, who watched as both her son and her aunt died in the shootings, summed up her feelings in two words: “Praise God.”