Dating back to October 2006 tanks at the stations were not properly maintained and inspected, and leak detection devices and alarm systems on tanks were tampered with, Harris and the prosecutors said in a suit filed Friday in Alameda County Superior Court.
The stations are operated by BP subsidiaries BP West Coast Products, BP Products North America, Inc., and Atlantic Richfield Company.
"Safe storage of gasoline is not only common sense, it is essential to protecting the integrity of California's groundwater resources," Harris said in a statement.
A spokesman for BP described the majority of the alleged incidents as "procedural violations."
"A small number of the alleged violations relate to the monitoring of tanks," spokesman Scott Dean said in a statement.
"None of the alleged violations posed any harm to human health or the environment," the statement said.
District attorneys from Alameda County, Glenn County, Merced County, Nevada County, Placer County, San Bernardino, Stanislaus County and Yuba County joined in the suit, Harris said.
The lawsuit follows a similar suit filed last month by Harris against ConocoPhillips and its spinoff, Phillips 66.