OAKLAND — Cancer-causing compounds in East Bay drinking water have increased sharply over the past several years, and water in some areas is close to violating a federal public health standard, the East Bay Municipal Utility District reported Tuesday.

Water-quality managers said the drought is at least partly to blame for the increase in contaminants called trihalomethanes or THMs, a byproduct of chlorine used to kill germs reacting with natural organic matter in water.

Related Articles How safe is your East Bay drinking water? The low flows and hot temperatures in the drought led to more impurities in water, and sped up their formation into harmful byproducts.

The drought also led to reduced customer water use that meant tap water stayed longer in district water tanks, spurring the need to add more chlorine that forms the unwanted byproducts, district officials said.

Concentrations of the contaminants are higher than they have been in nearly 20 years, and higher than an internal district goal, officials said.

“We see a steady increase in the THMs. We have a problem,” Brett Kawakami, the district manager of treatment and distribution, told a water board committee Tuesday. “The THM readings in two areas are approaching the maximum contaminant level” at which violations trigger a requirement to issue a public health advisory.

Those two areas are in Orinda and in the hills along the Oakland-Berkeley hills. But the contaminant level is on the rise throughout the district, officials said.

“The water is safe to drink,” said district spokeswoman Jenesse Miller, “but we have identified a long-term issue with our water that deals with risks of consuming it over a lifetime.”

Average district trihalomethane concentrations in 2016 averaged 58 parts per billion, exceeding the district’s internal goal of 40 ppb annual average. Areas with 80 ppb or more annual averages must issue a public health advisory.

The end of the drought has not lowered the concentrations in some areas as the district had hoped.

“THM concentrations have been increasing for the past few years. Concentrations have increased more significantly in the past few months,” district administrators wrote in the report.

Officials say they suspect that heavy winter rains washed organic matter, a precursor to THMs, into reservoirs that built up over hillsides during five years or drought.

To deal with the problem, the district is considering spending millions of dollars to refine treatment procedures or change equipment at some plants. The district also proposes to test the use of sedimentation basins and clarifier tanks to treat water.

District officials say they already have have taken some measures to change how and where disinfectants are added to drinking water to reduce the formation of the byproducts.

Because its Mokelumne water from the Sierra is such high quality, the district traditionally hasn’t built as elaborate and involved treatment plants as many other agencies that routinely use ozone gas and deep beds of granular activated carbon, said Michael Hartlaub, a district senior engineer in water treatment.

The drought brought to light the district’s vulnerability in several ways.

Warm temperatures and low water flows accelerated formation of algae and tiny organic organisms in Pardee Reservoir, where the district’s Sierra water is piped to the East Bay.

Warmer temperatures also sped the formation of contaminants, and caused chlorine to dissipate faster, leading water agencies to add more chlorine in tanks and pipes, leading to more THMs.

EBMUD provides drinking water to 1.4 million people in Contra Costa and Alameda counties in Oakland, Berkeley, San Ramon, Richmond, Walnut Creek and other areas stretching from Hercules in the north to San Leandro in the south.