(CBS SF) — The East Bay Municipal Utility District, Stege Sanitary District in El Cerrito and six cities have agreed to pay $1.5 million in fines to settle allegations they allowed raw or partially treated sewage to flow into the San Francisco Bay.

The Environmental Protection Agency filed the federal lawsuit back in 2009.

EBMUD and the cities of Alameda, Albany, Berkeley, Emeryville, Oakland and Piedmont also agreed to invest about $1.5 billion over the next 21 years to upgrade their aging 1,500 mile-long sewer system.

The cost is expected to be about $5 million a year for EBMUD alone. Homeowners would absorb a one-time increase of about 1 percent on wastewater rates, which currently average $19.95 a month per household according the San Francisco Chronicle.

The rate doesn’t include what cities would have to pay for repairs under the agreement.