Under threat of anti-trust action by the California attorney general, Valero Energy Corp. (NYSE: VLO) and Plains All American Pipeline LP (NYSE: PAA) have dropped a deal under which Valero would buy from Plains two petroleum storage and distribution terminals in Martinez and Richmond, Calif.

The sale passed muster with the Federal Trade Commission, but on July 12 the state filed suit in United States District Court for the Northern District of California, seeking to block the transaction. Notably, the court denied the motion for a temporary restraining order and the two companies initially vowed to defend the deal.

But in a joint statement they indicated a change of heart: “Plains and Valero have each decided that it is in their best interest to terminate the transaction rather than endure the continued uncertainty that a lengthy trial would create for the California-based employees and customers of the terminals, as well as the considerable expense associated with defending a taxpayer-funded lawsuit.”

Tara Kaushik, attorney with Holland & Knight Some legal and industry sources were surprised that state officials went so far as to seek a restraining order. It was also a surprise to some that the companies capitulated so quickly after the restraining order was denied.

“Those are pursued to prevent ‘irreparable harm to the public interest,’” explained Tara Kaushik, a San Francisco-based energy regulatory attorney with Holland & Knight LLP. “There is a pretty steep burden of immediate harm that cannot be undone. When the motion was denied the companies were free to proceed with the transaction, but with the possibility of hearings or a trial somewhere down the road.”

Local sources suggested to Hart Energy that the state opposition may have been to demonstrate that Sacramento was serious about regulating the oil and gas industry. It also bears mentioning that there have been several high-profile leaks, spills and fires at pipelines, terminals, storage caverns and refineries in the last few years. As a result the midstream is under the microscope in California.

But with the deal dead, it’s clear the state was serious.

“It is very clear that the state has a love-hate relationship with hydrocarbons,” said Kaushik. “We have a car culture, and the industry is not going away, but it seems that it won’t be allowed to grow. California may view oil and gas as necessary, so they won’t kill it, but they certainly look like they are going limit it.”

Regardless of the sentiment in Sacramento, business goes on. And Kaushik suggests that deals can still be done.

“The actions by the attorney general do have a long-term chilling effect in the industry, but I would suggest to midstream operators that if they want to do a deal of some kind that they do the extra research beyond just the business case,” she said. “Make the environmental case and the case for how the deal is good for consumers. Plug in understanding of the local situation. There are effective ways to comply with the regulations and also reach a political accommodation.”