The city of Philadelphia agreed yesterday to sharply reduce its pollution from sewage dumped into the Delaware River and the Atlantic Ocean as part of the largest settlement ever obtained in a municipal pollution case.

The settlement, announced by the justice department, requires the city to build$622 million in new treatment facilities at the city's three sewage plants. The consent decree requires the city to curtail its pollution of the Delaware by Nov. 1, 1983, and to halt by Dec. 31, 1980, the dumping of sewage sludge into the Atlantic that long has angered Eastern shore residents.

The settlement ended an acrimonious 10-year battle between thecity and the federal government which is requiring cities and towns across the nation to clean up their rivers.

Municipalities have been slow to build sewage plants in spite of the incentive of a$45 billion federal grant program that pays 75 percent of the cost. The program, the largest public works project in the nation, is designed to make the country's rivers fit for fishing and swimming by 1983.

Of the nation's 3,600 cities with populations exceeding 10,000 more than halfmissed a July 1977 deadline to install secondary treatment plants for sewage, but the federal government has been reluctant to prosecute, because many cities are strapped for funds.

The Environmental Protection Agency announced a major enforcement effort in 1977, and has filed 27 suitsagainst recalcitrant cities, including Detroit, Los Angeles and Phoenix. Others, such as Boston and New York, have been allowed to fall years behind a cleanup schedules.

The Philadelphia case, which was filed a year ago, is the first in which the justice department has obtained large penalties. The city agreed to pay $2.16 million into an environmental trust fund to be used for a storm sewer system and toxic substances monitoring.

The city will obtain its$173 million share of the cost of the sewage facilites through user fees. The rest will come from federal grants.

Assistant Attorney General James W. Moorman called the settlement "a precedent. It means a new erain the attitudes of municipalities. After years of fighting, Philadelphia decided to become a leader instead of a laggard. I hope some of theother big cities will notice."

Moorman said Philadelphia is "overwhelmingly the major polluter of the Delaware River, one of three major estuaries on the East Coast." The city currently discharges more than 450 million gallons of partly treated sewage into the river each day.

The consent decree requires Philadelphia to remove 86 to 90 percent of the pollutants in the sewage. Current treatment removes 35 to 65 percent.

Sewage sludge currently dumped in the Atlantic is to be deposited at sites around the state after the 1980 cutoff.

Joining the justice department in the suit were Maryland, Pennsylvania, the Delaware River basin commission, Sierra club, friends of the earth and audubon society.

"The Delaware River has been seriously polluted since World War II," said Albert Slap, an attorney for the Sierra Club. "You can't swim in it. There are fish kills. Now it's going to be cleaner, and the sewage plant construction will provide 17,000 direct and indirect jobs to Philadelphia. Cleanup pays."