COLUMBIA, S.C. – Inmates armed with homemade knives fought each other for more than seven hours inside a maximum-security prison, leaving seven of them dead, officials said. An inmate who witnessed the riot told The Associated Press that bodies were “literally stacked on top of each other.”

Officials didn’t immediately say what sparked the violence at the prison that houses some of the state’s worst and longest-serving offenders. No prison guards were hurt.

The prisoner who saw the riot exchanged messages with AP on the condition of anonymity because he is not allowed to have a cellphone and fears retribution from other inmates.

He also didn’t say what started the riot but said most of the inmates are affiliated with gangs and he saw several attackers taunt a rival gang member who was badly injured.

“I just saw three dead on the sidewalk outside of my unit. One guy is still alive and breathing, but just barely,” the inmate said.

The riot was the latest violence in the South Carolina prisons system, where at least 20 inmates have been killed by fellow prisoners since the start of 2017. At Lee Correctional, an inmate held a guard hostage for 90 minutes in March and another killed a fellow prisoner in February.

The inmate who spoke to AP said that many cell door locks were already broken before the riot and that he and other prisoners roamed around freely. Hours after the violence started, no correctional officers or medical personnel attended to the dead or dying, he said.

“It’s been over two hours, but no COs (corrections officers) have responded to this unit, and no medical personnel have attempted to render any kind of aid,” he wrote. “The COs never even attempted to render aid, nor quell the disturbance. They just sat in the control bubble, called the issue in, then sat on their collective asses.”

South Carolina prison guards are not armed, so as long as employees aren’t threatened, they typically seal off wings when there is an inmate uprising and wait for a special team of state police to arrive to try and stop the rioting.

The inmate told AP that he knew at least two of slain men well. He said he saw an inmate trying to get up before he “started into that ‘death rattle’ people often hear about, but never experience firsthand.”

Most of the slain inmates were stabbed with homemade knives or slashed, while the remainder appeared to have been beaten, Lee County Coroner Larry Logan told AP.

“How else are you going to die in prison? They don’t have guns,” Logan said by phone as he went to a hospital to finish identifying the dead.

The injured inmates required medical attention outside the prison, which is located 40 miles east of Columbia.

The South Carolina Department of Corrections tweeted that the deaths happened in multiple inmate-on-inmate fights in three housing units. It began at around 7:15 p.m. Sunday.

The coroner said when he arrived it was a chaotic scene of fighting everywhere. Logan said the state-run Lee Correctional Institution, like most other South Carolina prisons, is struggling to find enough workers, but he doesn’t believe anything could be done once things got that far out of control.

“If everybody has an uprising, you are always going to be understaffed,” Logan said.

The maximum-security facility in Bishopville houses about 1,500 inmates. Two officers were stabbed there in 2015.

The deaths at Lee are the most in any South Carolina prison in recent years. Four inmates were killed last year by a pair of prisoners at Kirkland Correctional Institution.

The riot was the latest violence in a system where 12 inmates were killed by other prisoners last year and 250 prisoners were assaulted so severely in 2016 and 2017 they had to be treated in outside hospitals, according to public records obtained by The Post and Courier of Charleston.

The 250 inmates taken to the hospital after assaults the past two years were nearly double the rate from the two years before, the newspaper reported.