The US Army Corps of Engineers said water from the rising Mississippi River and its tributaries threatened to spill over 19 federal levees, putting hundreds of homes in jeopardy.
Record flooding was projected in some Mississippi River towns after several days of torrential rain that caused sewage to flow unfiltered into waterways.
The Meramec River near St. Louis was expected to get to more than 3 feet (90 centimeters) above the previous record by late this week.
At least 18 deaths in Missouri and Illinois were blamed on flooding, mostly involving vehicles that drove onto swamped roadways.
The river spilled over the top of the levee at West Alton, Missouri, about 20 miles (30 kilometers) north of St. Louis. Mayor William Richter ordered any of the town's approximately 520 residents who had not already evacuated to get out of harm's way.
In another eastern Missouri town, Union, water from the normally docile Bourbeuse River reached the roofs of a McDonald's and several other businesses. The river reached an all-time high, nearly 20 feet (six meters) above flood stage.
Hundreds of smaller roads and highways were also closed across the two states, and flood warnings were in effect.
Missouri Gov. Jay Nixon activated the National Guard to assist with security in evacuated areas and to help keep road closure sites clear.
In southern Illinois, the Department of Corrections transferred an unspecified number of inmates from a state prison to other locations because of flooding risks. The facility houses nearly 3,700 inmates.
The city later trucked 1,500 of the sandbags south to a nearby county to fortify a wastewater treatment plant threatened by the swollen Big River
The Mississippi River is expected to reach nearly 15 feet (4.5 meters) above flood stage on Thursday at St. Louis, which would be the second-worst flood on record, behind only the devastating 1993 flood.
The high water was blamed for the shutdown of a wastewater treatment plant on Monday just south of St. Louis, causing sewage to go directly into nearby rivers and streams.
The Metropolitan Sewer District of St. Louis said the Fenton wastewater treatment plant, which is designed for 6.75 million gallons (25.55 million liters) per day of flow, was treating nearly 24 million gallons (91 million liters) per day at the time of the malfunction.
One of the two wastewater plants in Springfield, Missouri, also failed, allowing partially treated sewage to flow into a river.
In central and southern Illinois, flood warnings were in effect a day after a winter storm brought sleet and icy rain. Major flooding was occurring along the Kankakee, Illinois, Sangamon and Vermilion rivers.
The Midwest wasn't alone. Heavy rain continued in parts of the South, such as Georgia and eastern Alabama, which has in parts seen more than 14 inches (35.6 centimeters) of rain.

