Thanks to President Donald Trump, America's private prisons appear to be entering a gold age.

The stocks of the two biggest private prison operators -- CoreCivic (formerly know as Corrections Corp. of America) and Geo Group -- have doubled since election day. CoreCivic (CXW) is up 140% since Trump won in November; Geo Group (GEO) has risen 98%.

For all the talk about how good Trump has been for big banks like Goldman Sachs, he's been even better for private prison investors.

The reason private prisons are back in vogue is simple: Trump has made sweeping promises to crack down on crime and illegal immigration. Wall Street calculated quickly that Trump's rhetoric is likely to translate into more people behind bars. And that means more profits for private prisons.

Related: Wow. Stock market hits 10th straight record high

"We're getting really bad dudes out of this country, and at a rate that nobody's ever seen before," Trump said Thursday.

Wall Street expects prisons to get the biggest boost from Trump's plans to deport illegal immigrants.

The Department of Homeland Security is already trying to hire 10,000 new immigration officers and 5,000 more border control agents. On top of that, DHS intends to ask for more money to fund additional detention facilities.

Both CoreCivic and Geo Group have several thousand beds currently available that could be used for undocumented immigrants, says Michael Kodesch, a stock analyst at Canaccord Genuity. Private prisons currently house roughly 8% of America's 1.5 million federal and state prison population, according to Kodesch.

Trump's team embraces private prisons

On Thursday night, the Trump Administration sent an even clearer message that it plans to use more private prisons when Attorney General Jeff Sessions scrapped the Obama-era guidance to phase them out.

"This will restore (the Bureau of Prison's) flexibility to manage the federal prison inmate population based on capacity needs," Trump's Justice Department said.

Investors were thrilled, sending Geo and CoreCivic stocks even higher Friday. Shares of Geo now trade at an all-time high.

"Geo and CoreCivic are preparing to enter a sustained period of pro-private, tough on-crime policies alongside comprehensive immigration reform," says Kodesch. "We don't believe the rally has run its full course yet."

The Justice Department doesn't actually have many private prison contracts, but the announcement signals that private prisons are welcome in the Trump Administration. Both companies donated heavily to Republicans during the 2016 election, according to OpenSecrets.

Big U-turn from Obama administration

It was only a few months ago that private prisons looked like they were on their way out. In August, the Obama Administration slammed them for being more expensive and less safe than government-run facilities.

Private prisons "simply do not provide the same level of correctional services, programs, and resources; they do not save substantially on costs; and as noted in a recent report by the Department's Office of Inspector General, they do not maintain the same level of safety and security," former Deputy Attorney General Sally Yates wrote at the time.

After that, Hillary Clinton called for an end of private prisons in one of the presidential debates, sending Geo and CoreCivic stocks to their lowest level since the Great Recession.

Related: Trump gives America's 'poorest white town' hope

The outlook changed dramatically after Trump's historic win.

"We see a gale force tailwind of demand coming from immigration policy and border security enforcement changes," says Tobey Sommer, a stock analyst at SunTrust Robinson Humphrey.

The U.S. prison population has been declining in recent years, but analysts note that over 200,000 U.S. prison beds are in facilities that are more than 75 years old. States and the federal government may turn to private prisons instead of upgrading antiquated facilities.