Ten percent of water samples at California beaches last year contained more human fecal bacteria than the state allows, according to a study released Wednesday by the Natural Resources Defense Council.

Violations of daily maximum bacterial standards at 227 California beaches increased 4 percent from 2007 to 2008, the study found.

After Los Angeles and San Francisco, Contra Costa had the most polluted beaches with 12 percent of samples tested coming back with high bacteria.

The samples came from Keller Beach in Richmond. Alameda County beaches showed high bacteria levels in 9 percent of samples, and San Mateo County beaches showed heavy contamination in 6 percent of their samples.

"Many Californians were sickened or became ill after going to polluted beaches last year," Michelle Mehta, an attorney with the council's water program, said in a statement. "The problem of beach water pollution has not improved, and millions of people visiting California's world-renowned beaches continue to be at risk."

Although California may be famous for its surfing and swimming, the state ranked among the worst in beach water quality nationwide, coming in 22nd out of 30 coastal states.

Los Angeles County was home to the most polluted beach water, with 20 percent of samples exceeding state standards.

In May, Heal the Bay also ranked Los Angeles beaches as worst in the state for water quality.

Bacteria can flow into beach water from sewage accidents such as the spill that forced closures in Long Beach on Monday.

Storm water flowing through urban areas can also pick up animal waste, fertilizer, motor oil and other contaminants that are dumped into the ocean.

"We've described it as a toxic soup," Mehta said in a telephone interview Tuesday.

Although researchers linked 9 percent of contamination to sewage and 3 percent to storm water, the vast majority (81 percent) came from unknown sources.

The gap in knowledge underscores a need for better research, Mehta said.

High bacteria levels caused more than 20,000 beach closures and advisories nationwide and more than 4,000 in California. But local authorities sometimes don't have the financial resources to adequately monitor bacteria or to warn the public, according to Jessica Lass, a spokeswoman for the council.