The city of Salem released more than 22 million gallons of raw sewage into the Willamette River late Thursday and early Friday after heavy rain overwhelmed its sewer system.

The release was permitted under state environmental regulations, Nitin Joshi, the city’s environmental and regulatory affairs manager, said.

That’s because the 24-hour rainfall level passed a legal threshold of 2.61 inches, at 6:45 a.m. Friday.

“Once it hits that anywhere throughout the system, that allows them to approve the city’s bypasses or overflows,” Joshi said.

The release was necessary to keep sewage from backing up and flooding basements, city spokesman Mike Gotterba said.

When the ground becomes saturated, groundwater enters the sanitary sewer from cracks and holes in the pipes, footing drains and other sources from private property, Gotterba said.

“When this occurs the ability of the sewer system to transport sewerage to the water pollution control facility is exceeded and the system becomes surcharged,” he said.

City officials allowed raw sewage to enter the river at Union Street from 11:15 p.m. Thursday through 1:43 p.m. Friday, releasing 19.6 million gallons.

They opened the gates at the North River Road diversion structure from 4:15 a.m. Friday through 6:10 a.m. Friday, releasing 2.65 million gallons.

Officials also responded to a complaint at about 8:45 a.m. Friday about raw sewage flowing from a manhole at 544 Idylwood Drive SE into Pringle Creek. About 640 gallons of sewage was accidentally released to the creek, Gotterba said.

The releases were reported to the Oregon Department of Environmental Quality.

DEQ officials could not immediately be reached for comment.

City workers posted signs at both the Willamette River and Pringle Creek throughout the weekend warning the public to avoid the water, Joshi said. The signs were removed Monday after follow-up sampling showed normal bacteria levels., 503-399-6779 or follow at