ON THE outskirts of Columbia, South Carolina's capital, lies a rolling swathe of farmland where cattle graze, tomatoes sprout and razor wire glints in the afternoon sun. This well-tended campus is home to seven of the state's 28 prisons, including both Broad River, where inmates sentenced to die are lethally injected or electrocuted, and Campbell, which houses prisoners on work-release, who spend their days at fast-food restaurants or laundries and return to their “dorms” to sleep.

Part of their earnings goes to repay the cost of jailing them. And it is a cost: from 1983 to 2008 spending on the state's prisons increased more than sixfold, as its prison population rose from just over 9,000 to almost 25,000. That rise had several causes, among them the greater number of people imprisoned for non-violent crimes and the heavier sentences that came with new laws laying down mandatory minimum terms.

Another factor was the decision of South Carolina, like many states, to adopt statutes in the mid-1990s that said certain criminals had to serve 85% of their sentence before becoming eligible for parole. Those serving such sentences now account for 42% of the state's total prison population. Not only do these inmates clog the system, they are also less likely to take advantage of vocational training or education in prison, and more likely to be put back behind bars after their release.

On June 2nd South Carolina joined a growing number of states trying to bring their growing prison population—and the associated costs—to heel by changing the way criminals are sentenced. The bill that Mark Sanford, South Carolina's Republican governor, signed into law that day, after it sailed through the Republican-dominated legislature, allows non-violent drug offenders to be eligible for parole or probation rather than automatically being sent to prison. It requires drug offenders to pay a fine, which then goes to drug-treatment programmes.

It also improves post-release and parole supervision, easing prisoners' transition from incarceration to the working world and ensuring that fewer prisoners will be locked up for non-criminal breaches of their parole. At the same time, it increases penalties for some violent offences. The Pew Center on the States, which helped the state's sentencing-reform commission analyse data, believes this bill will save the state almost $250m in prison building and operating costs over the next five years.

Similar sentencing reform has taken hold in some unlikely places. Hang-'em-high Texas, by financing drug-treatment and mental-health services and improving post-release supervision, has dramatically slowed the rate of growth of its prison population. Mississippi has also avoided an expected increase by making non-violent prisoners eligible for parole after serving 25% rather than 85% of their time. The Pew Center is helping to draw up reforms in 22 states; the two most recent recruits are Arkansas and Indiana.