Donald Trump’s regressive law enforcement views may be the last best hope for private prison companies.

And given the past five weeks, they could use a lifeline.

Their stock prices have been brutalized. A host of law firms have started putting together class action lawsuits against them on behalf of their investors. And one company even announced layoffs.

That’s why Trump could be their saving grace. While Hillary Clinton is making opposition to private prison companies a campaign issue, the Republican nominee has praised prison privatization. And he has been loath to criticize anyone or anything associated with the American criminal justice system, instead making tough-on-crime rhetoric a key part of his brand. So a Trump victory could be a much-needed lifeline for the industry—while a Clinton win could cripple the businesses that contract with the feds to house prisoners.

Several federal agencies contract with private companies——in particular, GEO Group and Corrections Corporation of America, both of which are publicly traded––to handle incarceration and immigrant detention. It’s a lucrative industry. Last year CCA brought in $1.79 billion, according to its annual shareholder letter, and GEO Group reported $1.84 billion in revenue. Both companies saw revenue growth over 2014.

But that trend might be changing. On Aug. 18, the Department of Justice announced that the Bureau of Prisons would phase out its contracts with private prison companies. Deputy Attorney General Sally Yates said in a statement that the move was designed to “ensure that inmates are in the safest facilities and receiving the best rehabilitative services”——implying that the Department of Justice shares the concerns of a host of activists, who have argued for years that private facilities treat prisoners worse to save money.

A GEO spokesperson disputed that implication.

“We are and have always been a partner with the government as well as the communities we serve, working every day to be a part of the solution to society’s correctional needs," said Pablo Paez, the company’s vice president of corporate relations. Our profit motivation has not and will never compromise what we believe. We are most effective and at our best when those we care for re-enter society as productive and employable citizens.”

Steve Owens, a spokesman for CCA, said eliminating contracts with private corrections facilities would be costly and would result in more overcrowding and less re-entry programming.

“This is a political season, and we all recognize that rhetoric can get heated,” he added. “We hope that when the dust settles after the election that policymakers will come together and focus on real solutions. There is a lot that we agree on. For example, our company has stood up and made firm commitments to supporting and expanding re-entry programs that reduce recidivism. That’s the kind of leadership that is needed, and that has unfortunately been lacking from our political discourse. We look forward to working with the next administration to play a positive, problem-solving role.”

Though Yates didn’t mention any specific reports that prompted the change, it came shortly after Mother Jones published a lengthy and gut-churning investigative report by Shane Bauer, who worked for four months as a private prison guard.

The stock prices for GEO Group and CCA both took a nosedive on Aug. 18, and they have yet to recover. Things got worse the morning of Sept. 27. The night before, Clinton ripped into private prison companies at the debate.

“I’m glad that we’re ending private prisons in the federal system,” she said. “I want to see them ended in the state system. You shouldn’t have a profit motivation to fill prison cells with young Americans.”

The comment didn’t get much media coverage the next day (though it played extremely well in Pennsylvania, a key swing state). But it did a number on private prison companies’ stock prices. By the time the markets closed Tuesday, CCA’s stock had dropped by 8 percent and GEO’s was down 4 percent.

Both GEO and CCA are facing lawsuits. As often happens when a company’s stock takes a surprising dive, a bevy of law firms that specialize in representing allegedly jilted stockholders have filed class action suits against them.

In addition, CCA announced on Tuesday that it will eliminate upward of 55 jobs at its Nashville headquarters as part of an effort to cut costs. Its CEO also said he will give up a block of stock shares he got in February of this year. At the time, the stock was worth $2 million. Currently: not so much.

Despite all this, the corrections industry still has one bright, shining star: Donald J. Trump. In an interview with Chris Matthews in June, the Republican nominee praised the industry.

“I do think we can do a lot of privatizations and private prisons,” he said. “It seems to work a lot better.”

The line didn’t get much attention at the time because in that same interview Trump called for punishing women who get abortions. Trump’s campaign didn’t respond to a query about whether he still holds this view on the corrections industry.

Still, mealy-mouthed, months-old praise is still praise. And when you’re facing angry shareholders and a presidential candidate who loves to hate you, you take what you can get.

Updated 9/29/16, to add comment from GEO and CCA.