SAN FRANCISCO — Environmental nonprofit San Francisco Baykeeper won a summary judgment this week against West Bay Sanitary District in U.S. District Court, establishing the district’s legal liability for 21 separate sewage spills into San Francisco Bay.

The district could face up to $975,000 in fines under the Clean Water Act for sewer overflows that occurred between September 2004 and December 2009 — raw and partially treated sewage that flowed into San Francisquito Creek, Los Trancos Creek, Ravenswood Slough and several other urban creeks in San Mateo and Santa Clara counties.

Baykeeper Executive Director Deb Self said she hopes the preliminary judgment will bring the district into negotiations over ways to fix its aging, leaky sewer system. The district serves 55,000 residents in Menlo Park and parts of East Palo Alto, Redwood City, Atherton, Woodside, Portola Valley and unincorporated San Mateo and Santa Clara counties.

“It’s clear that not only are they liable, but that these spills illustrate a systemwide problem, and they will be made to fix the entire system,” Self said.

So far, however, the district has indicated it will be inclined to pursue its defense all the way to the 9th U.S. Circuit Court of Appeals.

Baykeeper has a reputation as a legal bulldog, and it won’t back down. Its campaign to stop sewage spills into the bay by threatening to sue public agencies has resulted in settlement agreements with 10 Bay Area cities and sanitation districts in the past six months. The cities and districts all agreed to overhaul their sewage treatment and collection systems or make necessary repairs.

The group’s strategy is simple: Its lawyers use reports of sewage overflows filed by the districts themselves with the Regional Water Quality Control Board. West Bay Sanitary District’s own records show 162 undisputed sanitary sewer overflows through the years, mostly due to flooding and tree roots poking holes in the collection pipes.

Baykeeper was able to prove, crucially, that sewage illegally reached the bay in 21 of those spills. If the case receives a full trial, the group intends to try to prove that for another 68 spills.

Tony Condotti, attorney for the district, denied the agency is facing an uphill battle after losing the summary judgment. None of the 68 spills reached the bay, he said, because district staff caught the sewage with sandbags and prevented it from entering local creeks.

It will be hard to convince a judge to punish the district with a $975,000 penalty — the maximum fine allowed for the 21 Clean Water Act violations — considering the volume of those spills was only 36,670 gallons, Condotti said.

“Most of the violations they’re referring to are one-molecule spills; they’re technical violations of the Clean Water Act without having any environmental effects or causing any harm,” he said.

If the district loses, it will presumably be able to afford the penalty. The agency had $14 million on hand in cash and cash equivalents as of June 2010, according to financial statements. The legal dispute with Baykeeper has cost approximately $250,000 in attorney fees, according to Condotti.

Self accused the district of wasting ratepayers’ money on a losing case while deferring important maintenance projects.

But district manager Phil Scott said the agency is starting to prepare a long-term master plan with a capital-improvement program that will fix or replace leaky pipes and add pump stations and other equipment. Starting in 2009, roughly around the time of the Baykeeper lawsuit, the district added more staff and equipment to monitor, clean and maintain its collection system, according to Scott.

Last year, the district spent $3 million replacing pipelines, and this year it plans to spend at least another $3 million.

“We do take overflows very seriously,” he said.

Contact Julia Scott at 650-348-4340.