While the deal has been in the works for months, a PBF representative said he was unaware of which agencies would need to approve it.

"Now that we have announced the pending acquisition of the Martinez refinery from Shell, we will begin identifying which agencies have oversight responsibilities for the transaction," PBF spokesman Michael Karlovich said in an email.

In fact, the Federal Trade Commission and the California Attorney General's Office would be tasked with overseeing the purchase, according to Edward Ortiz, a spokesman for the California Energy Commission.

The Shell facility is one of the Bay Area's five oil refining facilities and two in the Martinez area.

The company says the refinery has been in operation since 1915 and has touted it as one of the most complex in the world. It converts crude into vehicle gasoline, jet fuel, diesel and asphalt, among other products.

In March local air regulators announced that Shell agreed to pay $165,000 to settle 16 air violations at the Martinez refinery that took place between late 2015 and 2016. That included several penalties associated with an outage in Dec. 19, 2016, which forced the refinery to flare off nearly 20 tons of gases and send flames and black smoke into the sky.

Like other Bay Area refineries, the facility has experienced a number of minor flaring incidents in recent years. According to the Bay Area Air Quality Management District, problems at the refinery led the Shell Martinez plant to send gases to its flares 73 times between 2005 and last year.

Last Friday the refinery experienced a pump fire in a process unit, prompting workers to evacuate that part of the facility.

Environmentalists have not been happy with the refinery for years, and the change in ownership will probably not change that perception.

"Good riddance to Shell," said Hollin Kretzmann, an Oakland-based attorney with the Center for Biological Diversity.

"But the new operator has a history of excessive flaring at its other California refinery, so communities near this dirty refinery aren't likely to see these problems go away," Kretzmann said.

Kretzmann pointed toward a series of violations PBF's Torrance refinery committed in recent years that led to investigations and fines by the South Coast Air Quality Management District.