Sunoco Inc.'s Philadelphia refinery, which was threatened with closure at the end of this month, will be reborn as an "energy hub."

The Carlyle Group, a Washington private-equity manager, announced plans Monday to operate the refinery with Sunoco as a joint venture called Philadelphia Energy Solutions.

The venture will save 850 jobs at the refinery, the largest fuel-production plant in the northeastern United States, and may employ hundreds more if plans to expand production are realized.

Carlyle officials say they are "reimagining" the business to exploit new, cheaper domestic sources of crude oil to replace expensive imported petroleum, a major reason the refinery was uncompetitive. In September, Sunoco announced plans to exit refining and to sell or shut down the plant this summer, saying it was losing a million dollars a day on fuel production.

Carlyle, which will have a majority interest in the venture and operate the refinery, also plans to increase dramatically the use of low-priced natural gas from Pennsylvania's booming Marcellus Shale region to reduce refining costs and emissions.

"We believe the changing nature of the energy paradigm in the U.S., coupled with a redefined operating model, can truly benefit this refinery," Carlyle managing director Rodney S. Cohen said at a news briefing Monday. Immediate upgrades at the 330,000-barrel-per-day refinery will require more than $200 million of new capital, he said, but he would not disclose the extent of Carlyle's total investment.

Closure of the refinery would have had enormous repercussions. The U.S. Energy Department had warned that a shutdown could lead to spot shortages of fuels and spikes in price. The state estimates that the plant, which hires a constant stream of skilled contractors for maintenance projects, supports 10,000 jobs indirectly. The site, originally two refineries merged into one, occupies more than two square miles of South Philadelphia.

United Steelworkers union members, alarmed by the threatened closure of several refineries in the Philadelphia area, mobilized to pressure elected officials to take action. Key players described an unusual collaboration of the Democratic White House, Republican Gov. Corbett, U.S. Rep. Bob Brady (D., Pa.), and Democrat Mayor Nutter to urge Sunoco to find a partner to keep the facility open.

"It's a big win -- a big win for the community, for workers, for energy security in the United States," said Brian P. MacDonald, chief executive of Sunoco, which will retain a one-third nonoperating interest in the venture. "It's a really interesting situation where you had private equity, unions, and key politicians on both sides of the aisle working together."

Carlyle will receive $25 million in state grants to support upgrades at the refinery, including construction of a terminal to allow the high-speed unloading of railcars carrying crude from new oil-shale formations in North Dakota, Colorado, and Texas. Officials said they were also moving to include parts of the refinery in the Keystone Opportunity Zone so it can receive tax benefits for new construction.

State and federal environmental regulators have agreed to modify a 2005 consent decree to allow the Philadelphia refinery to receive some of the emissions credits assigned to Sunoco's Marcus Hook refinery, which was shut in December but, according to a consultant's report, could be converted to a variety of uses. Those temporary credits should allow the Philadelphia refinery to more quickly implement its expansion plans.

"This is huge, at a number of different levels," said Nutter.

Jim Savage, president of Steelworkers Local 10-1, which represents the plant's 600 unionized workers, said his membership was "over the moon" about the deal. The union voted Monday night on a new three-year contract that gives Carlyle more flexibility on work rules and pensions.

To run Philadelphia Energy Solutions, Carlyle has hired Philip L. Rinaldi, who turned around a troubled refinery in Coffeyville, Kan., in 2005 for another group of investors, Pegasus Capital Advisors.

Rinaldi, who lives in Bridgewater, N.J., said the new management intends to refurbish a residual catalytic cracker, a unit that turns heavy oil into diesel. The project will create more than 1,000 contracting jobs early next year. He added that the venture wants to refurbish other units that would optimize production of cleaner-burning ultra-low-sulfur diesel fuel, for which there is a big market demand.

The company also is exploring plans to build a co-generation plant to produce steam and electricity for the refinery, and possibly new production units to manufacture derivatives of natural gas, such as urea ammonium nitrate fertilizer, a product line Rinaldi built up in Kansas into a separate $1 billion business.

"The idea here is to build out that entire complex into a strong energy and chemical industrial site," said Rinaldi, who also serves as chairman of the board of New Jersey Institute of Technology.

Carlyle Group, which has $159 billion in real estate and industrial assets under management, has established a reputation for turning around stressed businesses and selling them for handsome profits. Former President George H.W. Bush, former British Prime Minister Sir John Major, and former Secretary of State James A. Baker III have served as advisers.

"Carlyle has been a very, very large investor for many years in what I would call unsexy industrial facilities," said David Marchick, Carlyle's managing director for external affairs. "We believe in manufacturing in the United States."

Carlyle was among the 150 prospective buyers that looked over the refinery last year after Sunoco announced that it planned to exit refining because of continuing losses. But Sunoco said it received no viable offers for the refineries. Only a few candidates had the operational experience and access to billions of dollars in finances needed to run such a capital-intensive business.

"Carlyle wouldn't even give us a number," said Lynn Elsenhans, Sunoco's former chief executive, who had overseen the company's painful sell-off of underperforming assets and noncore businesses, leading to the decision to exit refining.

But public officials and union leaders said they were frustrated working with Sunoco under Elsenhans, whom they said seemed to be hardened to the fate of closing the refineries. A critical moment, they said, came when MacDonald, formerly Sunoco's chief financial officer, succeeded Elsenhans as chief executive on March 1.

"Lynn Elsenhans was there to get out of the refinery business and was going about that," Corbett said. "My conversations with Brian have gone much easier than my conversations with her."

"I think if we hadn't had a change of leadership at Sunoco, this deal wouldn't have happened," said Leo W. Gerard, international president of the United Steelworkers. "The other person was intent on leveling the facility, it seemed to us. We couldn't get a sensible discussion with them."

In an interview, Elsenhans, who now lives in Houston, called such characterizations "totally unfair." The refineries were consuming Sunoco's cash, she said, and would have required a massive long-term investment to operate in a declining market for motor fuels.

She said she was "absolutely thrilled" that Carlyle came back to the table. "Maybe they have figured out a way to run it differently, to be cash-neutral," Elsenhans said.

Marchick, Carlyle's chief lobbyist, called Brady the "quarterback" who was "pushing and prodding" officials to take action.

"I just kept everybody talking," Brady said.

On Feb. 27, a few days before he formally took over as chief executive, MacDonald met in Washington with Brady. Both described the meeting as tense, but they cleared the air.

At Brady's urging, Gene Sperling, director of the White House National Economic Council, arranged a March 8 conference call with MacDonald, during which the Sunoco chief suggested that Carlyle might be a good candidate to run the refinery in a joint venture, rather than buying the plant outright.

Immediately after the meeting, MacDonald called Cohen at Carlyle. White House officials also called Carlyle executives that night, urging them to talk to Sunoco, said MacDonald and Carlyle officials.

Marchick credited MacDonald with coming up with the proposal to engage in a joint venture, which reduces Carlyle's risk and allows it to channel its investment entirely into operating the refinery.

"He's the one who came up with this creative structure, proposed it to us," Marchick said. "But for his involvement, this facility would be shutting down next month."

Contact Andrew Maykuth at 215-854-2947 or amaykuth@phillynews.com or follow on Twitter @Maykuth