Philadelphia Energy Solutions LLC, which owns the giant South Philadelphia oil refinery complex,   filed a bankruptcy plan Monday to reorganize its massive debt and blamed the burden of meeting federal renewable fuel standards as the culprit for its financial woes.

PES, which is owned by a joint venture of private-equity firm Carlyle Group LP and Energy Transfer Partners LP (ETP), filed the prepackaged plan with the U.S. Bankruptcy Court in Delaware to restructure $525 million of debt and bring in new owners. The refinery will continue operating and paying its bills while the reorganization takes place.

The 335,000-barrel-a-day refinery, the largest on the East Coast, employs 1,100 people and about 500 contractors. Current management, led by chief executive Gregory G. Gatta, will remain in place.

The company blamed its financial demise directly on the soaring price for renewable energy credits, called RINs, which cost the company about $217 million last year, its greatest expense after crude oil costs. The Trump administration in December reaffirmed the government's commitment to the Renewable Fuel Standard, rebuffing efforts of merchant refiners such as PES to revoke the ethanol rules, or at least shift the financial burden to others.

"It is unfortunate that the company was driven to this result by the failed RFS policy and excessive RINs costs," Gatta said Monday. "We can only hope that our filing today will provide the necessary catalyst for meaningful long-term reform of the RFS program."

Sen. Pat Toomey (R., Pa.) echoed the sentiment, blaming the bankruptcy filing on "counterproductive, job-killing, EPA-imposed Renewable Fuel Standard that requires an excessive amount of biofuel to be blended into the nation's fuel supply."

But ethanol-industry advocates and some analysts said that the refinery's financial troubles are related to the company's investment decisions and to complicated market conditions, not the renewable fuel standards.

Several Northeast refineries, including PES and Monroe Energy in Trainer, are configured to use more expensive light, sweet crude oil that is less profitable to refine, and have struggled in head-to-head competition with imported fuel, as well as low-cost refiners on the U.S. Gulf coast.

"There is no factual basis to suggest the financial woes of PES are a consequence of the RFS," said Bob Dinneen, chief executive of the Renewable Fuels Association.  He said the Philadelphia refiner could have invested in fuel-blending operations, which generate renewable credits and reduce the refiner's compliance cost.

"It chose a different course, slavishly pursuing a change in the law that fit its flawed business model," Dinneen said.

Since it was formed in 2012, PES invested about $900 million to improve the refinery, taking on debt when oil prices were high, profit margins were fat, and the refinery enjoyed an unexpected boom in discounted domestic crude oil brought in by rail.

With $25 million in state aid, the company under then-chief executive Philip Rinaldi invested $186 million in 2013 to build a rail terminal to receive domestic crude oil, which initially was hugely profitable, but became a white elephant when crude prices fell in 2015 and oil-by-rail was no longer attractive.

Carlyle and other equity owners also extracted more than $400 million in dividend payments out of the business during its profitable years, including $260 million in 2015 before the company's anticipated initial public offering, according to regulatory filings. The $250 million IPO valued the enterprise at $1.3 billion, but was canceled after investors balked at paying the company's desired price.

With a 2018 deadline looming on the debt payments, credit agencies last year cut the company's debt to junk-bond status.

The company was formed in 2012 with much fanfare after its previous owner, Sunoco, announced plans to exit refining, selling some plants and converting others to terminals, such as its Eagle Point refinery in West Deptford, and its Marcus Hook refinery. The Carlyle Group, a renowned Washington investment firm, owns two-thirds of PES. Sunoco has the other third.

The company prospered, but the worldwide fall of crude prices in 2015, along with the lifting of the oil exports ban that reduced the discount for crude from North Dakota's Baaken Shale formation, has cut into the refiner's margins.

PES announced in August it had hired investment bank PJT Partners Inc. to help restructure its debt. Kirkland & Ellis LLP served as legal advisers, and Alvarez & Marsal serves as its restructuring adviser.

The company's news release Monday assiduously avoids using the word "bankruptcy," but a memo distributed to employees on Sunday acknowledged the reorganization plan would be filed under Chapter 11 of the U.S. Bankruptcy Code. The case was filed in U.S. Bankruptcy Court in the District of Delaware.

"I know this may sound alarming, but I want you to know that this is an orderly process that will allow us to continue operations without interruption during this recapitalization," Gatta said in the memo.

The company obtained $260 million in new financing made up of $120 million in debtor-in-possession and exit financing, $75 million in additional capital from Sunoco Logistics Partners Operations L.P.,  which is owned by ETP, and a $65 million equity investment from existing equity holders, led by the Carlyle Group.

Owners of about $525 million in "Term B" debt, due in March, will extend $417 million of debt to come due in 2022, and exchange the remainder for 75 percent equity in the company. Credit Suisse Asset Management and Halcyon Capital Management, hold about 70 percent of the debt.

Carlyle and ETP, which is Sunoco's parent company, will see their stake shrink to a combined 25 percent minority share.

PES on Monday sought to rally supporters to make a new assault on the Renewable Fuel Standard. Gatta, the chief executive, pledged to work with the government to address "the broken" renewable fuel standards system.

Ryan O'Callaghan, who heads the Steelworkers local that represents 650 refinery workers, said he and many union members supported President Trump in the 2016 election because of his promise to reform regulations harmful to the refinery. He said he is having second thoughts.

"The president won Pennsylvania, and he won a lot of working-class union support, and that might not be there for him if this place doesn't work out," he said. "No Republican will have a shot."