A decades-old oil spill — even its clean up — can come back to haunt giant energy companies. A new U.S. court ruling this week overturned Kinder Morgan’s attempt to throw out a lawsuit by San Diego and California for an oil spill dating back more than a quarter century.

“We had to fight for it, but this decision means San Diego will have its day in court,” San Diego City Attorney Jan Goldsmith told Bloomberg.

The oil pollution came from the company’s petroleum tanks that seeped into the soil and groundwater during the 1980s and 1990s, prior to Kinder Morgan buying the Mission Valley Terminal in 1998.

The gas plumes also allegedly seeped under the city’s NFL stadium for the San Diego Chargers.

An investigation ordered Kinder Morgan in 1992 to clean it up, and then the company spent $75 million mitigating the pollution from the city’s 166-acre property.

The process involved extracting massive volumes of water from the ground table, treating it, and discharging it into waterways that flowed into the Pacific.

Trouble is, the City of San Diego has long said the company's discharged water was still highly polluted, and violated environmental rules.

The city sued, and Kinder Morgan fought to have the whole action dismissed. Initially, the energy giant won. But this new ruling by an appeal court overturned that earlier ruling, so a trial will go forward.

“The jury will hear that a substantial amount of pollution was dumped on city property through no fault of its own and that the adjoining property owner—not taxpayers—should bear the costs,” Goldsmith added.

San Diego is seeking a quarter billion dollars in damages.

A Kinder Morgan spokeswoman told Bloomberg this week that the company was reviewing its options and believes San Diego has suffered no harm as a result of the contamination, “other than the legal fees and costs incurred in pursuing this lawsuit.”