Seven oil companies, including petroleum giant Chevron, have been given until the end of the week by state officials to stop their decades-old practice of injecting oily wastewater into Central Valley aquifers or face penalties.

The state Division of Oil, Gas and Geothermal Resources ordered the companies to stop pumping wastewater from drilling operations into 10 underground aquifers, which the oil companies were using after government agencies charged with enforcing federal groundwater regulations first gave clearance to do so in the 1980s, then rescinded their approval 30 years later.

Thirty active injection wells must be closed by Dec. 31 or “we would pursue legal action and/or penalties,” said Teresa Schilling, spokeswoman for the resources agency. Violations carry fines of $2,500 to $25,000 apiece. Schilling said most operators are complying or have already complied with the order.

None of the aquifers is now used for drinking water, but environmentalists say they could be tapped in the future. Most are in the Bakersfield area, but one is in Solano County, near the Bunker Gas Field south of Dixon.

“This is a big deal because it’s about protecting underground drinking water,” said Keith Nakatani, the oil and gas program manager for the environmental group Clean Water Action. “We are increasingly reliant on groundwater because of the recent drought and a loss of snowpack — all the more reason to be protective of our resources. Yet the oil and gas industry has been allowed to pollute those resources for decades.”

Disposal of oil and gas drilling wastewater is a big issue in the Central Valley, where most of California’s petroleum production takes place. Kern County, the top oil-producing area in the state, accounts for 80 percent of California’s oil.

The 10 aquifers in question were supposed to be protected by the state, but a bureaucratic snafu led officials to believe that the oil companies had obtained exemptions under the U.S. Safe Drinking Water Act, which shields groundwater supplies from pollution.

The oil companies had been dumping leftover water from drilling for three decades by the time state regulators discovered a discrepancy a few years ago in the earlier approval. After further review, the state determined disposal in 10 aquifers needed to stop.

There is no evidence that drinking water in the Central Valley has been contaminated, but the revelation caused a furor and prompted lawmakers to demand reforms at the state agency that regulates oil-field operations.

Five companies including Chevron Corp., which manages nine of the injection wells, and Kern River Holdings Inc., which operates six, told the state they have set up replacement projects elsewhere.

“Chevron has developed alternative plans and will not be injecting into the aquifer subject to the Dec. 31, 2016, regulatory deadline,” company spokeswoman Isabel Ordóñez said in a statement.

The biggest impact will be on California Resources Corp., which must shut down 10 active injection wells. Company officials could not be reached for comment.

The EPA ruled in 2015 that the 10 aquifers being used by the oil companies lie too close to the surface — in one case, as shallow as 200 feet. Shallower water is usually better quality, with less salt, making it more suitable for drinking. Regulators and conservationists believe the potential use of the aquifers for drinking water should be protected.

An 11th aquifer known as the Walker Formation has also been used by the oil companies since 1983, but a portion of that one is under review by the EPA for an exemption, which would allow continued wastewater injections.

The shutdown order this week is part of a major statewide crackdown. The state has issued a Feb. 15 deadline for oil companies to halt injections in at least 50 other aquifers in the Central Valley and elsewhere unless the operators obtain exemptions.

California’s oil fields contain large amounts of salty water, the remains of an ancient sea. As a result, oil drillers suck up 15 barrels of water for every barrel of oil they reap.

If the water is clean enough, it can be treated and used for irrigation. But most of it contains other substances too, including boron and toxins that can poison groundwater and kill birds. The recommended way to get rid of it is to inject it into the ground, preferably into the oil-bearing formation or deep enough so that it won’t seep into an aquifer.

The problem is that for 33 years, state regulators have allowed oil companies to inject billions of barrels of wastewater into aquifers that contained water clean enough to be used for drinking or irrigation. Recent studies indicate that some of the injections may have caused earthquakes.

The division of oil and gas has identified a total of 178 wells that had injected wastewater into legally protected aquifers, a few of which were close to drinking water wells. Some of the injection wells had already been shut down, and others had been converted into oil extraction wells.

Over the past couple of years, the division, which is part of the California Department of Conservation, has shut down more than two dozen of the remaining wells, most of them in Kern County, with a couple in Ventura and Los Angeles counties.

The state devised a schedule for the rest of the closures to give oil companies time to make other arrangements. The slow pace of the closures has infuriated environmentalists, who want state officials to follow up after the February closures and study the cumulative effects of all the injections instead of just wiping their hands clean after the deadline passes.

“The oil and gas industry is the most influential lobby in Sacramento, so this is a big step in the right direction, but a lot more needs to be done,” Nakatani said.

Editor's Note: This story was been corrected from earlier print editions.