Two environmental groups have filed a lawsuit in U.S. District Court that could result in accelerating the timeline under which Cape Cod towns would be required to deal with nitrogen discharges that are polluting coastal waters.

The suit, filed last month by the Conservation Law Foundation and the Coalition for Buzzards Bay, contends that the U.S. Environmental Protection Agency has failed to meet its responsibilities under the federal Clean Water Act. The suit argues that Cape Cod would not be facing clean-up costs estimated at between $4 billion and $8 billion if a countywide water quality management plan issued in 1978 had been implemented.

A court ruling compelling the EPA to enforce regulations more aggressively could mean that Cape communities would face mandates similar to what resulted from the court-ordered cleanup of Boston Harbor in the 1980s.

Nutrients leaching from septic systems, fertilizers and road run-off have become the biggest remaining threat to water quality in Massachusetts. The problem is particularly notable in coastal areas such as Cape Cod, where an estimated 85 percent of homes and businesses rely on septic systems for wastewater discharge.

Local officials on the Cape say that much progress has been made in recent years, including the construction of wastewater treatment plants and the introduction of programs to protect drinking water.

Cape communities are facing hundreds of millions of dollars in capital costs to modernize and construct treatment plants to accommodate growth and to meet federal standards. Until recently, there has been no assistance available other than a low-interest loan from the state revolving loan fund. When the Clean Water Act passed in the 1970s, the federal government typically paid 75 percent of these capital costs while the state picked up 15 percent.

Last year, the Legislature passed a five-year, $1.66 billion energy and environmental bond bill, supported by the MMA, that included funding for wastewater projects. The legislation enables cities and towns to apply for no-interest loans from the state’s Clean Water Revolving Fund for reducing nitrogen and other nutrients in water through means such as sewer systems.

Members of the MMA Board of Directors also have met with the Massachusetts congressional delegation and other members of Congress to push for increased federal funding to help cities and towns comply with the Clean Water Act.