It was sudden, potentially deadly — and nothing any of the residents of a California valley town could have imagined.

Nearly 200,000 people were told to grab what they could — now — and head for higher ground or face being swept away by a breach in the Oroville Dam, the nation’s tallest.

Panic set in as the mass of Northern Californians were forced to confront a threat of biblical proportions: a 30-foot wall of water that threatened to come crashing down on their homes.

“Everyone was running around. It was pure chaos,” Oroville resident Maggie Cabral told local TV news station KFSN.

The ensuing exodus resembled a 1970s disaster movie.

“All of the streets were immediately packed with cars, people in my neighborhood grabbing what they could and running out the door and leaving,” Cabral said.

Residents endured hours of bumper-to-bumper traffic — and some drivers even ditched their cars on the highway when they ran out of gas.

“Nothing like this has ever happened,” Sean Dennis, a 30-year-old chef from Yuba City, told NBC News. “We just grabbed what we could.”

The major problem — a hole in an emergency spillway — surfaced when the outlet was put to use over the weekend for the first time in its 50-year history. The main spillway was damaged last week.

Authorities were deeply concerned the hole could cause the entire spillway to break down, releasing the rushing torrent of water on downstream towns.

By late Sunday, water was no longer flowing over the emergency spillway, but the evacuation order remained in place on Monday, as water officials continued draining Lake Oroville in preparation for more rainfall.

“We are using a wide variety of monitoring techniques, including 24/7 people on the ground, live-feed video and drone resources to make sure that we understand the dynamics behind our existing system,” acting water resources director Bill Croyle said Monday.

Lake Oroville, California’s second-largest reservoir, has been filled to the brim as the result of an unusually wet winter, following years of drought.

Last week, the reservoir’s main spillway, which is made of concrete, suffered severe damage by erosion and developed a 200-foot-long, 30-foot-deep hole that continues to grow.

Recent heavy rainfalls forced the use of the earthen emergency spillway for the first time ever on Saturday, which rattled some people living in downtown Oroville.

“I have my bags packed, and I’m on alert,” Doreen Schmidt told the Los Angeles Times over the weekend.

It wasn’t until Sunday that engineers noticed the hole was threatening to compromise the entire spillway.

The central concern was that a concrete wall at the top of the spillway could crumble, causing a catastrophic amount of water to pour out of the reservoir and flood into neighboring towns.

“When you start to erode the ground, the dirt and everything else starts to roll off the hill,” said Kevin Lawson, California Fire incident commander.

“It starts to undermine itself. If that is not addressed, if that’s not mitigated properly, essentially what we’re looking at is approximately a 30-foot wall of water.”

Around 4 p.m. Sunday, 188,000 residents were told to evacuate due to a “hazardous situation.”

“This is not a drill. Repeat, this is not a drill,” the National Weather Service warned.

Gov. Jerry Brown issued an emergency order to “bolster the state’s response,” and California’s National Guard notified 23,000 soldiers that they should be ready to jump into action.

Luckily, by Sunday evening, water levels in the lake had been brought down by increasing flow down the main spillway, and water had stopped pouring over the emergency one.

“There are still a lot of unknowns,” Butte County Sheriff Kory Honea cautioned.

“We have staff looking at the various areas that evacuations have been ordered in and making a determination as to what areas are clearly in danger and what areas may be less vulnerable.”

On Monday, water was pouring out of the reservoir’s main spillway at a rate of about 100,000 cubic feet per second — as officials hope to reduce the lake’s water level to 50 feet below the emergency spillway.

That task is especially urgent since more rain is set to fall as early as Wednesday evening. So far, that spillway hasn’t seen any additional damage from the increased water flow, officials said.

“There’s been no additional erosion on the main spillway,” said Chris Orrock, a state Department of Water Resources spokesman. “We will continue at 100,000 [cubic feet per second].”

Workers were also busy gathering boulders in bags, so they could be used to patch up the emergency spillway’s hole.

At a Monday press conference, Honea called it a “dynamic situation” and said it was still unclear when people would be allowed to return to their homes.

“We need to have time to make sure that before we allow people back into those areas, it is safe to do so,” he said.

“I recognize that this is displacing a lot of people. I recognize what a hardship it has placed upon our community.”

Residents expressed their frustrations about being left in limbo as authorities continue to assess the 770-foot-tall dam.

Doris O’Kelley, 84, of Oroville, who spent Sunday night on a cot at the Silver Dollar Fairground in Chico, wished officials would be more forthcoming.

“I’d like to see them be a little more plain about what’s going on,” she told the Los Angeles Times.

More than 500 people poured into a Red Cross shelter in Chico on Sunday night, as others holed up in hotels and motels on safe ground. Churches and schools have also opened their doors to those seeking shelter.

This isn’t the first time there have been concerns about the breakdown of the emergency spillway.

In 2005, three environmental groups — the Friends of the River, the Sierra Club and the South Yuba Citizens League — filed a motion urging the feds to cover the auxiliary spillway with concrete.

They insisted that erosion could cause a “loss of crest control.”

“A loss of crest control could not only cause additional damage to project lands and facilities but also cause damages and threaten lives in the protected floodplain downstream,” they wrote.

The state Department of Water Resources and other water agencies decided that the upgrades would be unnecessary — and federal officials insisted the emergency spillway could comfortably handle 350,000 cubic feet per second, according to the Oroville Mercury Register.

“The emergency spillway meets FERC’s engineering guidelines for an emergency spillway,” wrote John Onderdonk, a senior civil engineer with the Federal Energy Regulatory Commission’s San Francisco office.