The untreated urban sewage and effluents that flow into the Great Lakes each year are threatening a critical ecosystem that supplies water to millions of people, according to a study by a Canadian environmental group.

Even though municipalities in the Great Lakes region have spent vast sums of money in recent decades upgrading their wastewater plants, the situation remains appalling, said the Sierra Legal Defence Fund.

Sierra Legal said in a report to be formally released Wednesday that it studied 20 Canadian and American cities, analyzing municipal sewage treatment and discharges into the Great Lakes basin, the Canadian Press news agency reported on the report Tuesday, saying it received an advance copy.

• Click here to visit FOXNews.com's Natural Science Center.

The survey graded municipalities in areas such as collection, treatment and disposal of sewage based on information provided by the local governments.

The main problem, the environmental group said, is that in many cases, antiquated sewage systems are incapable of dealing effectively with the vast amounts of effluent that flow through them.

• Click here to read the report (PDF format).

The situation is especially bad when heavy rains overwhelm treatment systems in cities where storm run-off is collected in the same pipes as sewage.

Some 24 billion gallons of untreated effluent enter the Great Lakes every year through combined sewage overflows, the study found.

Canada's worst offender was Windsor, Ontario, which — along with U.S. cities Detroit and Cleveland — performed "abysmally."

Cities such as Toronto and Hamilton also earned below-average grades.

At the top end, the Peel Region just west of Toronto, Green Bay, Wis., and Duluth, Minn., were the best performers, thanks largely to their ability to keep rain water and sewage separate.

The report makes several recommendations, including improving water conservation in order to reduce the flow to sewage plants, and keeping rain water out of sewers by disconnecting downspouts and separating storm drains and sewer systems.

"We need to change our ways and stop treating the Great Lakes like a toilet," the report concludes.