The city of Madelia, Minn., has been pumping raw sewage down closed streets and into the Watonwan River for the past several days as record floods have overwhelmed its wastewater treatment system.

The move was needed to avoid widespread sewage backups throughout the area, Madelia Police Chief Rob Prescher said in a statement, warning people to stay out of the water.

"You don't want to walk through that stuff," he wrote.

Communities throughout the flood zone faced similar troubles. A total of 98 wastewater treatment plants in Minnesota have had to pump untreated wastewater into streams and rivers since heavy rainstorms began on June 21, according to the Minnesota Pollution Control Agency.

As of Tuesday, 39 of the plants had reported the releases had stopped.

Untreated sewage can cause a host of health problems and complicate cleanup efforts after floodwaters recede.

Wastewater systems are designed to handle normal volumes of sewage, MPCA spokeswoman Andrea Cournoyer said in a statement. Major storms can cause too much wastewater for them to handle.

"These bypasses and releases are last-resort steps," Cournoyer said.

Repairs are underway to a damaged lift station at the Madelia treatment plant, which will start operating again as soon as possible, said Ryan Visher, the emergency management and safety director for Watonwan County.

"There have been great strides in the last 48 hours," Visher said. "The river has receded. Homeowners are starting to breathe a sigh of relief."

Madelia, a city of 2,400 about 25 miles southwest of Mankato, was forced to close bridges and roads this week as water levels rose. On Sunday the city asked all residents and businesses to limit showering and running dishwashers and washing machines because of the overwhelmed sewage system. An emergency shelter was set up in case people needed to evacuate.

Tony Downs Foods Company, a meat processor and one of the area's biggest employers, temporarily shut down.

The Watonwan River, which runs through the city, flows northwest and empties into the Blue Earth River upstream from the Rapidan Dam, which nearly failed under the force of the flood.

After the Blue Earth River carved a new path around the dam by Tuesday morning, the Watonwan started to quickly recede, Visher said.

"You hate to think of something like that helping, but when the dam released everything started flowing along quicker and it allowed the (Watonwan) river to crest a little sooner," he said.

The city of Le Sueur, along the Minnesota River north of St. Peter, also had a lift station fail. The plant had to release untreated wastewater in the Minnesota on Tuesday, said Joe Roby, the city administrator.

Roby said the sewage release, which has stopped, was not a "Plan B" but a "Plan D or E."

"There comes a point where there is nothing you can do other than risk further damage or put the infrastructure or public safety at risk," he said.

Staff writer Christopher Vondracek contributed to this story.