But on Wednesday, both stocks recouped some of those losses. CoreCivic gained 43 percent, while GEO climbed more than 21 percent.

In August, the Department of Justice instructed its Bureau of Prisons to begin phasing out the use of private contractors for federal corrections facilities. Both stocks tanked on the news, but analysts called the market reaction overblown, and questioned how feasible it would actually be for the federal government to build new housing for displaced prisoners.

But little more than a week later, the Department of Homeland Security Secretary Jeh Johnson directed Immigration and Customs Enforcement to "review our current policy and practices concerning the use of private immigration detention and evaluate whether this practice should be eliminated," according to a statement.

The stocks fell particularly far after presidential candidate Hillary Clinton expressed her support for the moves and her intention to build on them.

"I'm glad that we're ending private prisons in the federal system," Clinton had said in her first presidential debate with Donald Trump. "I want to see them ended in the state system. You shouldn't have a profit motivation to fill prison cells with young Americans."

Days after Clinton made her remarks, both stocks posted their worst quarters in more than 15 years.

Now that Clinton has lost, and Democrats failed to gain control of Congress, it appears investors are more sanguine about the future of the businesses.

Correction: This story was revised to correct that Democrats failed to gain control of Congress rather than lost control of Congress. The story was also updated to reflect that the Corrections Corporation of America has renamed itself CoreCivic.