Two years ago, we visited Red Onion State Prison, a super-maximum-security penitentiary in southwest Virginia, and came away deeply troubled by the numbers of prisoners being held in solitary confinement, or “segregation.” We called for the commonwealth to reform the practice. The Post’s editorial page agreed.

Prisoners in segregation are confined to an 80-square-foot cell for 23 hours a day, seven days a week. They typically get one hour a day of recreation five times a week, during which they are confined to a 96-square-foot, fenced area that can be described only as a cage. They eat alone in their cells and, by design, have little, if any, interaction with others.

We believe that treating prisoners with serious mental illnesses in this way violates the Eighth Amendment’s prohibition against cruel and unusual punishment.

A great deal has changed in two years, however. Last month, we returned to Red Onion and saw firsthand the effects of a dramatic turnaround in philosophy and treatment of prisoners in solitary confinement. The number of prisoners in segregation at Red Onion and Wallens Ridge — Virginia’s other super-max prison — has been reduced by a remarkable 62 percent, from 468 in 2011 to 179 as of last month. The number of grievances filed by the inmates at those facilities have also plummeted, from 10,476 in 2011 to just 2,175 through over the first eight months of this year.

Under the leadership of Marla Decker, Virginia’s secretary of public safety, and Corrections Department Director Harold Clarke, the prisons have instituted an innovative “step-down” program that allows inmates to work their way out of segregation. Here’s how it works: First, prison officials evaluate inmates to identify the best candidates for success. These men are provided with classes and programs covering areas such as substance abuse, anger management, social skills development and problem-solving. Initially during group discussions, participants are confined adjacently in small cells; as they progress, they are handcuffed to desks and finally are permitted to take part without any restraints. Privileges to attend group meals and extended recreation periods are earned and serve as motivation.

The prisoners aren’t the only ones receiving training. Correction officers are also receiving continuous training to help them better communicate with prisoners, identify troubling situations and defuse them without incident.

During our visit to Red Onion, inmates told us that the program has been nothing short of life-changing. It’s hard to put into words all that the program has accomplished. Two years ago, many prisoners in segregation had little hope. Now, they can see a path to an existence beyond their own cell.

This year, the Southern Legislative Conference recognized the department’s new program with its State Transformation in Action Recognition Award for its efforts.

You may ask: Why not just “lock them up and throw away the key”?

Approximately 90 percent of Virginia’s prisoners will one day be released back into the general public. The step-down training methods have been shown elsewhere to reduce the rate of recidivism, preventing new crimes involving additional victims and saving taxpayers the cost of re-incarceration. Who would you rather have living in your community: a person who sat stewing year after year in near-total isolation or one who has spent his time learning new ways to communicate, solve problems and control his anger?

Reducing the number of prisoners in segregation is also saving Virginia resources. It is more costly to house offenders in segregation than in the general prison population. And the prisons have become safer places to work, improving the morale of corrections officers. The number of reported incidents such as disobedience and rules violations has fallen by 65 percent.

More can still be done. More mental health services are desperately needed. Some inmates will not be released from segregation until their sentences are complete, and it is vital that they receive mental health treatment before then. A few inmates will not succeed in the program and will always remain in segregation. Many of those who complete the program will need continued mental health treatment or risk ending up back in segregation.

Those details aside, the Corrections Department should be commended for its new philosophy and innovative program. Virginia is off to a good start toward solving a big problem.

Patrick A. Hope (D-Arlington) is a member of the Virginia House of Delegates. Adam P. Ebbin (D-Alexandria) is a member of the Virginia Senate.