New Delhi: U.S. refiner PBF Energy Inc on Tuesday agreed to pay up to $1 billion for a California oil refinery that Royal Dutch Shell PLC has been trying to sell for at least four years. Terms of the deal require Shell to pay about $70 million for turnaround costs anticipated in the first quarter of 2020, and about $40 million in compensation for downtime, if the deal does not close by the first quarter of 2020, PBF said in a presentation. The deal is expected to close by December and is expected to be “significantly accretive” to PBF‘s earnings and cash flow, the company said. Shell had put the Martinez, California plant on the market in 2015 and later suspended its sales efforts after a fire at the refinery. The refinery 30 miles northeast of San Francisco has been operating since 1915. “The recent global macro softness could have helped the parties to come to an agreement,” said Matthew Blair, a refining analyst at investment bank Tudor, Pickering, Holt & Co. PBF has been interested in balancing its production in California, where it operates a 160,000 barrels per day (bpd) plant in Torrance, Blair said. “They wanted the two refinery systems, especially considering that when Torrance goes down they just have that one refinery and they don’t make anything back,” Blair said. The Martinez plant can process 157,000 bpd of crude oil into gasoline, jet fuel, diesel and other refined products. It also has a coker unit used for processing heavy grades of crude. PBF had earlier looked at buying the refinery from Shell, but was unable to reach an agreement and it recently re-approached the Anglo-Dutch oil giant, a person familiar with the matter said. PBF said the acquisition would expand its West Coast operations and increase its overall throughput capacity to over 1 million bpd. The deal also gives PBF a leading position to supply International Maritime Organization 2020-compliant fuels, the company said.