PHILADELPHIA (Reuters) - Philadelphia Energy Solutions (PES) will seek to permanently shut its oil refinery in the city after a massive fire caused substantial damage to the complex, the company confirmed on Wednesday, a day after sources told Reuters about the plans.

“The recent fire at the refinery complex has made it impossible for us to continue operations. We are grateful that the fire resulted in only a few minor injuries,” PES CEO Mark Smith said in a statement. “We are committed to an orderly process to safely wind down our operations.”

Shutting the refinery, the largest and oldest on the U.S. East Coast, will cost hundreds of jobs and squeeze gasoline supplies in the busiest, most densely populated corridor of the United States. Smith, in his statement, said the company will “position the refinery complex for a sale and restart,” though such a process would probably take years and face community opposition.

Workers at the complex were leaving the refinery on Wednesday, some escorted by security, others alone, carrying boxes with personal belongings to their cars, with several confirming they had been laid off. Employees have been instructed to immediately begin the process of mothballing units, sources familiar with the company’s plans said.

“I was stunned (when) I found out,” said Wayne Flood, a refinery worker who was let go Wednesday. He did not say what his job was before getting into his car.

About 100 non-union employees will be laid off immediately, with a “significant” number of the 700 union employees expected to lose their jobs in mid-July, the sources said.

“I’m extremely disappointed for the more than one thousand workers who will be immediately impacted by this closure, as well as other businesses that are dependent on the refinery operations,” Philadelphia Mayor Jim Kenney said in a statement.

The 335,000 barrel-per-day (bpd) complex, in a densely populated area in the southern part of the city, erupted in flames early on Friday in a series of explosions that could be heard miles away.

“The impact of the closure will be a massive blow to the local economy,” said Ryan O’Callaghan, head of the refinery’s union, estimating that it would cost tens of thousands of jobs when contractors and other businesses that rely on the plant are included.

Other refineries have taken years to restart after suffering substantial damage to processing capabilities. A much smaller refinery in Superior, Wisconsin, closed last year due to a fire and is not expected to restart at full production until 2021.

The cause of the fire remained unknown, though city fire officials said it started in a butane vat around 4 a.m. EDT (0800 GMT). It destroyed a 30,000-bpd alkylation unit that uses hydrofluoric acid to process refined products. Had the acid caught fire, it could have resulted in a vapor cloud that can damage the skin, eyes and lungs of nearby residents.

The refinery had struggled financially for years, forced to slash worker benefits and scale back capital projects to save cash. After a period of prosperity built on bringing in discounted crude oil via rail from North Dakota, the refinery fell on hard times, even as then-owner Carlyle Group paid itself nearly $600 million in dividend-style distributions.

It went through a bankruptcy process last year to reduce debt, but cash on hand dwindled even after it emerged from bankruptcy last summer.

Slideshow ( 7 images )

In January, PES dramatically scaled back a large maintenance project in the section where the explosion occurred last week, sources familiar with the plant’s operations told Reuters

After bankruptcy, Credit Suisse Asset Management and Bardin Hill became the controlling owners, with former primary owners Carlyle Group and Sunoco Logistics, an Energy Transfer subsidiary, holding a minority stake.

The blaze was the second in two weeks at the complex, spurring the mayor to call for a task force to look into the cause and community outreach in the wake of the incidents. That task force will now be retooled to focus on helping the company transition the site of the refinery and supporting employees affected, Kenney said in his statement.

Slideshow ( 7 images )

Investigators on the scene are dealing with unstable structures that need to be certified by engineers, slowing down the inquiry, city officials said. The investigation could ultimately take months or perhaps years, they said.

In addition, the company halted the restart of its gasoline-making unit at the other section of the refinery complex, the Point Breeze section, the sources said. That unit had been closed after a June 10 pump fire, where nobody was injured.

The state Department of Environmental Protection said on Tuesday it was concerned about the integrity of storage tanks on site.

U.S. gasoline futures rose as much as 5.4% on Wednesday to $1.9787 a gallon, the highest since May 23. The front month price was at $1.9704, up 5%, on Wednesday.

Graphic: U.S. gasoline futures jump on news that U.S. refinery may seek shutdown after fire, click tmsnrt.rs/2FwkXOw