FRANKFORT, Ky. — Kentucky is getting back into the private prison business because state officials say they have nowhere else to house their surging inmate population.

Justice and Public Safety Cabinet Secretary John Tilley signed a contract Thursday with CoreCivic, the Tennessee-based private corrections company formerly known as Corrections Corporation of America. The state plans to move about 800 inmates from the 80-year-old Kentucky State Reformatory to the Lee Adjustment Center in Beattyville over the next four months.

Kentucky had inmates in three private CoreCivic prisons as recently as 2008. But the state let those contracts expire after years of problems including allegations of sexual abuse and a prison riot in 2004. The state closed the last of its private prisons in 2013, when its inmate population dipped below 20,000 following legislation designed to put nonviolent drug offenders into treatment instead of behind bars.

But since then, Kentucky has faced a wave of opioid addiction that led to a record number of overdose deaths. The state legislature has responded by toughening penalties against drug dealers and others. That helped boost the state’s prison population to an all-time high of more than 24,600 inmates earlier this year. All of Kentucky’s prisons are full, and so are the 70 county jails that house state inmates.

“This was the only option,” Tilley said.

Private prisons have been controversial nationwide in recent years. The Obama administration had directed U.S. officials to phase out the use of private federal prisons following a harshly critical government audit. But under the Trump administration, U.S. Attorney General Jeff Sessions last February signaled his strong support for the federal government’s continued use of private prisons.

Kentucky has had problems with CoreCivic in the past. The state recommended a $10,000 fine against the company following a 2004 riot at the Lee Adjustment Center where inmates set fire to an administration building and ripped up sinks and toilets. And in 2010, former Democratic Gov. Steve Beshear removed all female inmates from the Otter Creek Correctional Correctional Center following allegations of sexual abuse of prisoners and a sex scandal involving guards.

More recently, an audit of CoreCivic’s prisons in Tennessee found the company was operating some prisons without enough officers and withheld many of its staffing records from state auditors.

“The notion that they would go back to this company really is an indication that they have learned nothing from their past experiences,” said Alex Friedmann, associate director of Human Rights Defense Center and a former inmate at a CoreCivic prison in Tennessee.

Tilley said questions about the state’s past problems with CoreCivic are fair, but said “that’s why we worked so hard to ensure this agreement is as tight as it can be.” He praised the company for agreeing “to every demand we placed on them.”

Tilley said CoreCivic must follow all of the state’s policies, including hiring the same number of officers used at other prisons in the state and using the same training, safety and security protocol. The state will get final say on the people CoreCivic hires, and will run background checks on all applicants. If the company violates any of those terms, the state could fine them $5,000 per day, per inmate, per offense. The state could also withhold payments as punishment.

CoreCivic spokesman Jonathan Burns said the company is committed to reducing recidivism. And in addition to Kentucky’s accountability standards, Burns noted the company is also scrutinized by the American Correctional Association, which he says “thoroughly audits our buildings, staff and services.”

“We play a critical role for systems like Kentucky’s that are overcrowded, which can create dangerous conditions for staff, inmates and communities,” Burns said.

The contract will cost about $16.8 million per year, or $57.68 per inmate per day. It costs the state $64.09 per inmate per day at a comparable facility.

Tilley called the contract a “short term fix.” He said he still plans to lobby the legislature to reform its criminal code so it will send fewer people to prison. For example, he said it’s a felony in Kentucky to steal something worth $500 or more. In most other states, that felony threshold is much higher, up to $2,500. But if the legislature opts not to make changes, Tilley noted the state has two other private prisons it could open if needed.

“If something doesn’t change, there is no question we will have to open those two private prisons,” he said. “And those will not be revenue neutral. That will be additional expense.”