Eight years ago, lawmakers in South Carolina embarked on a bold plan to reform the state's criminal justice system.
A 2010 criminal justice reform package, aimed at cutting the number of people sent to South Carolina prisons for low-level offenses, led to a 14% drop in inmates by 2016.
That allowed the state to close three maximum-security prisons and slash millions of dollars in annual prison spending from its budget.
More from USA Today:
One came to Waffle House to eat. One came to kill, police say. How two worlds collided.
Could Trump allies really impeach Deputy AG Rod Rosenstein? Not likely, experts say
Trump and Nigerian leader 'didn't discuss' disparaging remarks about African nations
While South Carolina's prison system now ranks among the country's cheapest for taxpayers, it's also become one of the deadliest for inmates.
Now, the state's prison system is under scrutiny after seven inmates were stabbed and slashed to death April 15 in the nation's deadliest prison riot in a quarter-century.
While policymakers in many states have been lauded for similar efforts to reduce the prison population and spending, South Carolina's experience may serve as a cautionary tale of the problems that can come with rapid spending cuts.
South Carolina's cost cutting went beyond just imprisoning fewer people. State officials also reduced mental health and other programs aimed at rehabilitation and eliminated amenities and activities that can keep prisoners busy. In some prisons, it also has meant more mixing of violent and non-violent inmates and fewer guards.
The same kinds of cuts have been happening across the nation from New Jersey to Nevada. After decades of constant growth, the nation's prison population peaked in 2009 before decreasing 7% between 2009 and 2016.
The riot at Lee Correctional Institution, a 1,785-bed prison in rural South Carolina, is part of an uptick in violence in prisons nationwide that has killed and injured inmates and guards alike and cost taxpayers millions of dollars in settlements.
Across the country, states slashed prison spending by more than $200 million between 2010 and 2015. Meanwhile, violence appears to be on the rise, according to a USA TODAY review of public records, lawsuits, academic studies and news reports.
Slayings reported inside prisons almost doubled over a decade, from about four homicides per 100,000 to about seven killings per 100,000 inmates in 2014, according to the most recent data published by the U.S. Bureau of Justice Statistics.
While the federal government doesn't maintain data on prison riots, state records and news media accounts show there were at least nine prison riots nationwide in 2017 — matching levels last seen in the 1980s.
While efforts to reduce South Carolina's prison population stemmed from good motives, the push to defund prisons is likely contributing to recent violence, said Hannah Riley of the Southern Center for Human Rights.
"If not done really carefully, then this ends up being the result of it, which is really tragic," she said.
While state officials attributed the seven-hour riot at Lee Correctional to gangs, some blamed the outbreak of violence on living conditions.
"I believe that conditions not just at Lee but all across our state are deplorable, are third-world, and don't reflect the kinds of standards that we have an obligation to uphold in this state," South Carolina state Rep. James Smith said.
All seven inmates killed in the riot bled to death after being stabbed, slashed and beaten, according to Lee County Coroner Larry Logan. Cellphone images show the bloodied bodies of the dead stacked in the prison yard.
Problems in South Carolina's prisons began coming to light long before the riot.
Inmates complained in lawsuits that South Carolina's prisons are home to "uncontrolled violence," where there are far too few guards, cells are left unlocked and gangs "run free and commit whatever crimes they want within the institution without fear of punishment," according to some of the 160-plus lawsuits filed against the state Department of Corrections since 2015.
And just this week, federal prosecutors indicted 14 former prison workers for bribery and bringing drugs, cellphones and contraband into South Carolina prisons.
At the Lee Correctional facility alone, this month's riot was preceded by the deaths of 22-year-old Christian Ray in a stabbing in July and 51-year-old Lee Rainey in a fight in November.
Just in 2017, the riots killed one corrections officer and left at least 12 injured, and saddled taxpayers with millions of dollars in legal fees and settlements.
In Delaware last February, one corrections sergeant was slain during a riot at the James T. Vaughn Correctional Center. State investigators ultimately blamed the rioting on the prison being "critically understaffed." The state paid $7.5 million to settle a lawsuit filed by the family of the corrections officer.
In Oklahoma in July, two corrections officers were taken hostage during a mele involving about 400 prisoners at Great Plains Correctional Facility.
"There is no simple fix," said Bert Useem, a professor at Purdue University who has studied prison riots. "Crucial is strong, effective administration. This means more than military discipline. It also requires provision of programming, cell space that's adequate and amenities to a reasonable degree."
In South Carolina, last year's violence included an incident in which two prisoners at Kirkland Correctional Institution in Columbia said they strangled four fellow prisoners to death. They lived in a block where their cells were left unlocked because they were considered trustworthy. One told a reporter they killed because they wanted to be executed, saying they could no longer bear the conditions of prison life.
Prison crowding gets a lot of attention but is generally less a factor than staffing, said Marc Mauer, executive director of The Sentencing Project, a Washington-based criminal justice reform advocacy group.
"Most of the research on the issue shows that it's the management of the prison that's really critical in determining just the scale of problems that develop," he said.
Shaundra Scott, executive director of the ACLU of South Carolina, said the understaffing problems in the state's prisons are exacerbated by poor mental health care and failure to separate non-violent offenders from violent inmates.
"I'm not saying that they need to have a five-star hotel, but they're still human beings at the end of the day," Scott said. "You're in there to be in prison to pay your debt to society, and you shouldn't have to worry if you're going to die while you're in there because there's not adequate protection."
Experts say maintaining proper staffing levels is key to preventing prison riots and disturbances — a persistent problem in South Carolina, where one in five of the state's prison guard jobs are vacant.
"The guard-to-prisoner ratio has gotten to a really unsustainable point where there aren't enough guards," Riley said. "The jobs that the guards do are incredibly hard. They're paid very poorly. There's just not enough of them."
In the federal prison system, the ratio is about one corrections officer for every 10 inmates. The South Carolina riot occurred with 44 guards on staff for 1,583 inmates — one guard for every 35 or so prisoners.
"Forty-four at Lee is good," South Carolina Department of Corrections Director Bryan Stirling said at a news conference following the riot.
Not all experts agree with Stirling's assessment.
"That certainly sounds like a small number of staff for that number of inmates," said Michele Deitch, a senior lecturer at the University of Texas at Austin's Lyndon B. Johnson School of Public Affairs, who added the security level and layout of a facility must also be taken into account
"You need to have adequate numbers of well-trained, high-quality staff who are properly deployed," Deitch added. "And that's just a given in any prison system if you want to operate it safely."
According to the Department of Corrections, the starting salary for a correctional officer at maximum security prisons is $34,596. The agency's chief told reporters in January about one-fourth of those jobs were unfilled.
South Carolina's spends $20,053 per prisoner. That's the ninth-lowest in the U.S. in 2015, according to data compiled by the non-profit Vera Institute of Justice. The state cut overall prison spending 2.4% over those five years.