As the hours dragged on during a riot at a South Carolina prison, bodies piled up on the sidewalk. An inmate inside watched in dismay as several fellow prisoners, two he knew well, lay dead and dying, their bodies leaving trails of blood leading back inside the prison walls.

One bloodied man tried to get up before he “started into that ‘death rattle’ people often hear about, but never experience firsthand,” the inmate told The Associated Press after the attack. Moments later, the dying man was silent, another casualty of the night’s events.

The inmate sent messages to AP as events unfolded overnight Sunday into Monday morning at Lee Correctional Institution. At the end of the seven-hour ordeal, seven inmates lay dead, with 17 others sent to hospitals for treatment.

With many cell door locks broken at Lee, a maximum-security prison, the inmate told AP he freely went outside, where he said he saw bodies “literally stacked on top of each other, like some macabre woodpile.”

State officials Monday blamed the carnage on a turf war between gangs over territory, money and contraband items like cellphones. For seven hours, Corrections Director Bryan Stirling said, inmates armed with handmade knives fought each other, leaving seven dead in the worst U.S. prison riot in a quarter-century. Most of the slain were stabbed or slashed; the remainder appeared to have been beaten, Lee County Coroner Larry Logan said.

The first fight started in a dorm about 7:15 p.m. Sunday and appeared to be contained before suddenly starting in two other dorms. No prison guards were hurt. Stirling said they followed protocol by backing out and asking for support. It took several hours to restore order, but once a special SWAT team entered, the inmates gave up peacefully, he said.

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 said he saw several attackers taunt a rival gang member who was badly injured.

“The man died laying on a sidewalk with some of the people who helped kill him laughing at him and taunting him,” the inmate told AP.

The inmate said he and other prisoners roamed around freely at the prison in Bishopville, about 40 miles (65 kilometers) east of Columbia. Hours after the violence started, no corrections officers or medical personnel attended to the dead or dying, he said.

“The COs (corrections officers) never even attempted to render aid, nor quell the disturbance,” he said. “They just sat in the control bubble, called the issue in, then sat on their collective asses.”

Stirling said the response teams entered as fast as they could.

“We gathered as many people as we could, as quickly as we could and went in as soon as we thought it was safe for our staff,” he said.

The slain were serving anywhere from 10 years to life in prison, and their crimes ranged from murder to trafficking crack cocaine. The youngest was 24 years old; the oldest was 44. According to Stirling, the injured inmates required medical attention outside the prison, which made restoring order more difficult for authorities.

The coroner described a chaotic scene upon his arrival, with inmates still fighting. The maximum-security facility in Bishopville houses about 1,500 inmates and 44 guards were there when the first fight started.

The riot was the latest violence in the South Carolina prisons system, where at least 13 other inmates have been killed by fellow prisoners since the start of 2017. It was the most inmates slain in a single riot in the U.S. since nine prisoners and a guard died in 1993 at the Southern Ohio Correctional Facility, said Steve Martin, a consultant who helps the federal government monitor prison systems.

Cellphones helped stir up the trouble, according to Stirling, who urged the federal government to change a law and allow state institutions like his to block prisoners’ cell signals.

Gov. Henry McMaster told reporters that jamming signals from contraband cellphones — already banned in prison but smuggled in by the thousands via visitors, errant guards, even delivered by drone — would “go a long way” in preventing future violence in prison.

When pressed on proposing a solution other than jamming, McMaster offered no specifics.

“We do the best we can,” he said.

State Sen. Gerald Malloy, a Democrat whose district includes Lee Correctional, summed up the day more bluntly.

“It’s an incredibly bad day in South Carolina,” he told AP. “We failed. That’s it.”

WHAT OTHERS ARE CLICKING ON:

>>MORE STORIES