An aerial photo released Saturday by the California Department of Water Resources shows the damaged spillway with eroded hillside in Oroville, California. California Department of Water Resources Authorities ordered the evacuation of almost 200,000 residents in several northern California towns Sunday evening, as a rapidly eroding section of a dam appeared on the verge of collapse.

"Immediate evacuation from the low levels of Oroville and areas downstream is ordered," the Butte County Sheriff's Office posted on Facebook.

"Operation of the auxiliary spillway," the sheriff's office said, had led "to severe erosion that could lead to a failure of the structure. Failure of the auxiliary spillway structure will result in an uncontrolled release of flood waters from Lake Oroville."

Anticipating the failure of the dam's auxiliary spillway, officials in the northern California town frantically attempted to drain water from the main spillway, at a clip of 100,000 cubic feet a second, according to The Sacramento Bee. Helicopters dropped sand and rocks into a sinkhole in the spillway to stem the erosion.

"It's uncontrolled. It's uncontrolled," Department of Water Resources spokesman Chris Orrock said when asked how much water could be released should the spillway fail.

Later Sunday evening, officials said the threat of collapse from erosion had diminished, according to The Sacramento Bee. Water levels fell to a point at which little or no water flowed out of the emergency spillway, which Orrock said was the main factor in its erosion.

An evacuation center was set up in Chico, a nearby town north of Oroville, the sheriff's office said on Twitter. Traffic heading out of Oroville appeared to slow to a crawl as thousands of residents attempted to flee. Residents of seven towns in neighboring Yuba and Sutter counties were also instructed to evacuate. The number of residents ordered to evacuate totaled at least 188,000, the Associated Press reported.

A driver waiting in traffic to evacuate Marysville, California, on Sunday. Rich Pedroncelli/AP Unexpected erosion this week resulted in a massive sinkhole forming in the dam's main spillway, a mile-long concrete gutter that controls the flow of excess water. Officials initially shut off the flow of water down the spillway, but heavy rainfall on Saturday caused the dam to overflow for the first time in its 49-year history, according to the Associated Press.

The overflow triggered the first-ever use of the dam's emergency spillway, which itself began showing signs of damage, causing officials to issue the evacuation warnings.

The deterioration was severe and rapid. Just four hours before the evacuation warnings, around midday Sunday, another Department of Water Resources spokesman had said he didn't anticipate the failure of the spillways. The dam itself is structurally sound, the spokesman had added.

At 770 feet, Oroville Dam is the tallest dam in the US. It could take up to $200 million to repair the damaged spillway, according to the Los Angeles Times.