A bitterly divided Senate confirmed Republican Senator Jeff Sessions as the next attorney general of the United States. REUTERS/Kevin Lamarque

WASHINGTON (Reuters) - The U.S. Justice Department has reversed an order by the Obama administration to phase out the use of private contractors to run federal prisons.

In a memo made public on Thursday, Attorney General Jeff Sessions said the Obama policy impaired the government’s ability to meet the future needs of the federal prison system.

The Obama administration said in August 2016 it planned a gradual phase-out of private prisons by letting contracts expire or by scaling them back to a level consistent with recent declines in the U.S. prison population.

It said privately operated prisons were less safe and a poor substitute for government-run facilities.

“The (Obama administration) memorandum changed long-standing policy and practice, and impaired the bureau’s ability to meet the future needs of the federal correctional system. Therefore, I direct the bureau to return to its previous approach,” Sessions said in a letter dated Tuesday to Thomas Kane, acting director of the Federal Bureau of Prisons.

Shares of the two leading U.S. private prison companies gained in after hours trading, with GEO Group Inc up 2.15 percent and CoreCivic Inc up 3.44 percent.

Thirteen of the federal government’s 146 prisons are privately run. Together, those 13 housed 22,600 inmates as of December 2015, down from about 40,000 in 2014.

The Bureau of Prisons began contracting with private companies in 1997 at a time of severe prison over-crowding.