This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

(CNN) — Dylann Roof, accused of the racially motivated massacre last year at Charleston’s Emanuel AME Church, was attacked and beaten Thursday by another inmate in a South Carolina jail, authorities said.

Charleston County Sheriff Al Cannon Jr. said that Roof, who is in protective custody at the Charleston County Detention Center, was out of his cell and on his way to the shower when the attack happened.

The other inmate, Dwayne Stafford, 25, now faces assault charges. No weapons were involved in the attack and Roof was able to return to his cell after being treated, sheriff’s deputies said.

Cannon gave no motivation for the attack. He said Stafford was able to access the protective custody unit and attack Roof with his fists because guards had violated security procedures. Both guards weren’t on the floor of the unit and Stafford’s cell door was not checked to make sure it was secure before Roof was let out his cell, Cannon said.

Only one prisoner is allowed out of a cell at a time, Cannon said.

Roof, 22, faces the death penalty for the June 2015 shooting that killed nine people, including Rev. Clementa Pinckney, at the historic black church, known as “Mother Emanuel” African Methodist Episcopal Church. After he was captured, Roof, who is white, told authorities he wanted to start a race war with the killings.

On Monday his lawyers filed a legal challenge to the U.S. death penalty, saying it was “arbitrary and cruel” and therefore unconstitutional. They said Roof would drop the challenge if federal prosecutors dropped their decision to seek the death penalty.

Roof is charged with 33 federal offenses, including hate-crime charges for allegedly targeting his victims on the basis of their race and religion.

“The nature of the alleged crime and the resulting harm compelled this decision,” Attorney General Loretta Lynch said in May, regarding prosecutors’ efforts to pursue the death penalty.

CNN’s Shawn Nottingham contributed to this report.