In the not too distant past, the Palmetto State had a reputation for warehousing its troubled youths behind razor wire when they ran afoul of the law.

But changes during the past two decades or so have put South Carolina near the forefront of states seeking to find alternatives to prison for young offenders in an effort to steer them back on the right path.

A new Pew Charitable Trusts study shows South Carolina is among 19 states that have seen steep declines in the number of young people being confined to prisons and other facilities for crimes.

South Carolina’s population of incarcerated young offenders dropped 67 percent between 1997 and 2011, placing the Palmetto State among the top 10 states that have reduced their juvenile prison population, the study found.

Margaret Barber, director of the state Department of Juvenile Justice, said the decline was no accident. The state has been working hard for years to find ways of rehabilitating children rather than placing them in lockup. For some youths, there is no choice but to house them behind bars. But many others benefit much more from staying in the community under the guidance of probation and other programs designed to help them move beyond the bad decisions that landed them in trouble, she said.

“We at DJJ are totally elated at what’s happening,” she said. “It’s taken a long time to get to where we are now.”

The nation as a whole has seen a marked decline in the number of incarcerated youths. Nationally, the juvenile commitment rate dropped 48 percent between 1997 and 2011. The decline between 2006 and 2011 was 34 percent, nearly double the reduction from 2001 to 2006, the Pew study found.

The national decline follows a parallel drop in juvenile arrests for violent crimes, which have been falling since the mid-1990s. At least 37 states experienced a decline in both juvenile commitment and violent-crime arrest rates between 1997 and 2010, the Pew study found.

Ryan S. King, research director for Pew’s Public Safety Performance Project, said the reasons for the change “are a pretty varied story” from state to state, but the overall shift is “absolutely encouraging.”

King said it appears states are increasingly recognizing the high cost and low return of placing lower-risk youth in state facilities. Though placement costs vary substantially, many states spend nearly $100,000 or more per offender annually, he said.

Barber, who began her career as a youth probation counselor in 1968, took over South Carolina’s Department of Juvenile Justice in 2011. Prior to that time, she worked closely with former DJJ Director William Byars, who took the helm in 2003. Byars is widely credited with turning around the agency after a decade of federal monitoring resulting from a lawsuit alleging overcrowding, physical abuse and inadequate medical care at DJJ’s three prisons.

Byars has described the old system as a counterproductive “disgrace” that warehoused kids in prison “slums” with nothing to do and few chances for rehabilitation.

The agency’s approach has shifted to moving as many young offenders as possible out of correctional settings and into wilderness camps, intensive probation and other community-based initiatives.

“We work to find resources, programs and community partnerships that will assist these kids at home, if at all possible,” Barber said.

The Pew report stated that South Carolina had 426 youth offenders committed to confinement in 2011. That number included youths placed in facilities such as group homes and camp-like programs, as well as secure correctional facilities, the organization stated.

Barber said the number of youths held in a correctional setting is much lower. Of the 17,000 or so youths referred to DJJ in the 2011-2012 fiscal year, only 126 were housed at DJJ’s three correctional institutions on Broad River Road in Columbia, agency statistics show.

As of this week, 105 young offenders were under long-term supervision at the Broad River complex, Barber said. Even there, the focus has shifted to providing education, vocational skills and other tools for rehabilitation, she said.

“If you get behind the razor wire, we don’t just warehouse you here,” she said. “You begin to become a responsible citizen so when you leave here you can get a job and, hopefully, you don’t return at all.”

Reach Glenn Smith at 937-5556 or Twitter.com/glennsmith5.