Story highlights Dylann Roof is accused of gunning down nine African Americans at a historic Charleston church

He was out of his cell and on his way to the shower when the attack happened Thursday

(CNN) Dylann Roof, accused of the racially motivated massacre of nine African American parishioners last year at Charleston's Emanuel AME Church, was attacked and beaten Thursday by a black inmate in a South Carolina jail, authorities said.

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

Although he was in protective custody, Roof, 22, was vulnerable because only one guard was in the area and he was fetching toilet tissue for another inmate, Cannon said. That allowed another inmate, 25-year-old Dwayne Stafford, time to run down the stairs from his cell in the protective custody unit and assault Roof with his fists, the sheriff said.

No weapons were involved in the attack and Roof was able to return to his cell after being treated, Cannon said.

JUST WATCHED Charleston church gunman called a racist bigot Replay More Videos ... MUST WATCH Charleston church gunman called a racist bigot 07:31

"The detention officer responded quickly and separated the two," Cannon said. "The injuries that Roof received are relatively minor -- some bruising around the face and the back. It appears he was struck with a fist and nothing more serious than that."

Read More