Franklin Resources Inc., known for contrarian bets on Ukraine, is shopping in another dicey neighborhood: the U.S. shale patch.

The firm has staked 16.3 percent of its flagship $92 billion Franklin Income Fund on energy stocks and bonds, according to data compiled by Bloomberg, an increase from 15.8 percent in June, when oil prices began their decline. Ed Perks, the fund’s lead manager, is zeroing in on the hardest-hit energy firms, whose funding avenues are narrowing as banks bolt.

“A lot of investors wanted to flee the energy space,” Perks said in an interview. “We saw it as a significant opportunity. People were too willing to draw a line in the sand. They weren’t differentiating enough between companies.”

Perks, 44, is leading a trend of alternative investors stepping in to save oil drillers, upending long-held relationships with banks. The funds in some cases have directly replaced bank lenders at the top of a company’s capital structure, giving them first dibs in a bankruptcy.

Franklin has been pouring so much investor money into the industry that it may be the biggest creditor to distressed energy companies, according to Spencer Cutter, an analyst with Bloomberg Intelligence in Skillman, New Jersey.

It’s a risky bet, and one that customers have so far greeted with ambivalence. After two years of steady growth, Franklin’s largest fund has seen outflows for the last five months, according to data compiled by Bloomberg that adhere to standard industry calculations. Franklin, which oversees about $880 billion through the Franklin and Templeton mutual funds, doesn’t comment on fund flows.

If it goes Franklin’s way, the bet could redeem a gamble on Ukraine debt that backfired.

Templeton global bond funds managed by Chief Investment Officer Michael Hasenstab loaded up on more than $7 billion of Ukraine’s bonds, whose value collapsed in the wake of conflict between Ukraine and pro-Russian rebels. Based on disclosures at the end of 2014, the $7 billion investment was worth $4 billion.

Other funds are pushing into the $200 billion market for junk-rated energy debt. Los Angeles-based Oaktree Capital Group LLC, the world’s biggest distressed-debt investor, has put about 8 percent of the firm’s $90.8 billion holdings into energy, it said Feb. 9. New York-based Mudrick Capital Management LP, which oversees $1.2 billion, has increased its exposure to energy to about 22 percent, said a person with knowledge of the firm.

Energy companies are getting squeezed by shrinking credit lines from banks after oil prices plunged by almost half from June to March. They’re issuing new bonds secured by collateral. The buyers, new second-lien secured bondholders, rank above existing creditors and get preferential treatment in a bankruptcy. So as defaults rise, Perks and other fund managers are angling to gain a seat at the negotiating table in the event of bankruptcies.

This month, San Mateo, California-based Franklin invested in the equity and debt of Halcon Resources Corp., the Houston- based shale company headed by Floyd Wilson. Halcon raised $700 million from notes backed by collateral last week with Franklin’s help.

Franklin also agreed to buy $100 million of second-lien senior secured notes to help Houston-based Goodrich Petroleum Corp. repay borrowings under a credit line that’s being reduced, according to a March 18 regulatory filing. It has the largest reported positions in the debt of Houston-based companies Vantage Drilling Co., Hercules Offshore Inc. and Energy XXI Ltd., according to data compiled by Bloomberg.

Franklin stepping in removes the risk for drillers that banks will pull financing altogether, said Keith Bachman, who oversees $6 billion as head of U.S. high yield at Aberdeen Asset Management Inc. in Philadelphia.

“This rescue financing may just keep these companies alive,” he said.

Perks denies that what Franklin is doing is rescue financing. “I would say it was opportunistic,” he said. He was speaking generally about his fund’s investments and declined to comment on specific companies.

Perks has employed a similar strategy with two coal-mining companies, St. Louis-based Peabody Energy Corp. and Fortescue Metals Group Ltd.

Franklin advised East Perth, Australia-based Fortescue on the structuring of new senior debt, helping the company raise $2.3 billion when other lenders balked.

“Given the scale we have and the relationships we have, the fact that we can engage people pretty quickly and that we’ve been a party that companies are familiar with, we can to try to identify solutions,” Perks said.

The tactics assume investors will remain loyal after performance trailed 92 percent of peers in the fourth quarter, according to Chicago-based Morningstar.

“There have definitely been periods where their performance will look pretty terrible and this is one of those times,” said Michael Herbst, Morningstar’s director of active strategy research. “People know to expect this. For those who didn’t necessarily expect this performance from this fund, they might head for the exits. But over time their long-term performance has proven to be excellent.”