Hedge fund billionaire Paul Singer was no fan of Donald Trump, but he has the President-elect to thank for a big payoff on one recent trade.

Last quarter, Singer’s firm Elliott Management placed bets worth approximately $100 million on two private prison stocks, GEO Group geo and CoreCivic cxw , the company formerly known as Corrections Corporation of America. Today, Singer’s holdings in the jail operators are worth more than $150 million—a profit of more than $42 million and a return of almost 40% in less than two months.

Prison stocks broke out of their funk after the presidential election last week, as Trump’s victory assuaged fears that Hillary Clinton would shut down private prisons, something she’d suggested during her campaign out of public safety concerns. CoreCivic, then still called Corrections Corp., was the top-performing stock the day after the election, up nearly 50%, while GEO Group stock rose 21%. (The company since then has implemented a name change that it announced in October.)

Still, Singer was not necessarily hoping Trump would win, even if he stood to benefit from that outcome. In June, the hedge fund manager predicted that Trump’s trade policies would cause a “widespread global depression,” and said that he might not vote for either Trump or Clinton.

During the campaign season, Singer gave millions of dollars to Republican groups promoting GOP candidate Marco Rubio and opposing Donald Trump. Singer additionally donated more than $2 million to a political action committee supporting Republican politicians who are committed to equal rights for gay and transgender Americans.

GEO Group stock, Elliott’s larger holding of the jail stock pair, has soared 36% since it showed up in the hedge fund’s portfolio at the end of September, according to securities disclosures released Monday. CoreCivic’s shares have risen more than 40% over the same time period.

Before the election, Elliott was already leading its hedge fund peers, returning 8% year to date, according to a person familiar with its performance.

Singer wasn’t alone in betting on for-profit prison companies ahead of last week’s vote. Other hedge funds that added the stocks to their portfolios in the third quarter include Bloom Tree Partners, a so-called Tiger Cub hedge fund seeded by Tiger Management founder Julian Robertson, which made $24 million on CoreCivic and GEO Group stock since then. David Einhorn’s Greenlight Capital has also gained more than $2 million on its GEO Group shares since investing in the company last quarter.