Brushing aside an environmental group’s objection, a federal judge has given the city of Baltimore another 13 years to eliminate the chronic sewage overflows that frequently render local streams and the harbor unsafe for recreation.

U.S. District Judge J. Frederick Motz approved a consent decree on Thursday spelling out a new plan for overhauling Baltimore’s aged, leaky sewer system. It modifies the initial agreement reached in 2002 with federal and state regulators, which had given the city until January 2016 to fix its problems. Despite spending nearly $1 billion on repairs over that time, by city officials’ estimates, the overflows continue.

The revised plan, which was originally unveiled in June 2016, drew criticism from local residents and environmental groups. It was revised after closed-door talks and resubmitted in late August, with provisions added to address sewage backups in homes and to provide more information to the public.

Under the new agreement, the city pledges to carry out a series of upgrades that it projects should reduce overflows by 80 percent after four years, with further improvements to be completed by the end of 2030. The projected cost of the new work is $1.6 billion, with much of that to be borne by local residents and businesses, though federal and state funds have been offered to lighten the burden on ratepayers.

The bulk of the overflows should be remedied, city officials say, by fixing a major misalignment in the “headworks” of the city’s Back River wastewater treatment plant. That causes a 10-mile backup of sewage beneath Baltimore and significantly reduces the capacity of the system to handle additional flows during heavy rains.

Blue Water Baltimore, the local watershed watchdog group which had been granted the right to intervene, welcomed the changes but asked the judge last month to reject the deal, unless it was further strengthened.

Noting the failure of previous repairs to end overflows, the group wanted an additional provision added that would have required that the city to adjust its repair plans and do more if stream and harbor monitoring doesn’t show sufficient water-quality improvements.

Lawyers representing federal and city officials urged the judge to disregard the environmental group’s complaint, saying that the sewer repairs alone cannot be expected to make Baltimore’s water safe. Other sources of contamination that impact waterways, including those caused by illegal connections of sewer lines to storm drains, are to be dealt with separately in the city’s stormwater permits, they said.

Angela Haren, Blue Water’s advocacy director and the Baltimore Harbor Waterkeeper, said the group is encouraged that the Maryland Department of the Environment and U.S. Environmental Protection Agency both agree that “all useful data,” including water-quality monitoring, should be considered when determining whether the city’s sewer repairs have succeeded.

“We look forward to working cooperatively with the city and all stakeholders to ensure the consent decree is effective in securing the clean water future we all deserve,” she said.