Taxpayers have spent billions of dollars on dams, levees and bypasses to keep Sacramento and other Central Valley towns and cities from flooding, but experts say the infrastructure would prove no match for a megastorm like the one that pummeled Houston this week.

“It’s still going to flood some day,” said Jeffrey Mount, a watershed expert with the Public Policy Institute of California. “There’s still going to be that rare large event, which will overwhelm us. Houston is the reminder that you cannot engineer your way out of flooding.”

Flood control officials in Houston say Hurricane Harvey has caused at least a 500-year flood, meaning it beat the 0.2 percent odds of that much rain falling at one time. Nearly 52 inches dumped on Houston in four days, according to the National Weather Service. That’s the most ever recorded for a single storm in the continental U.S., and about what Sacramento usually receives over a three-year period.

Could such a megastorm happen here? It would be bigger by far than any ever recorded, but experts say climate change is making what were once considered impossible storms more likely.

Never miss a local story.

Sign up today for a free 30 day free trial of unlimited digital access.

And like Houston, whose infrastructure was rated for 100-year-flood protection (a 1 in 100 chance of flooding in a given year), a megastorm of that size would almost certainly overwhelm the Sacramento region’s flood-control defenses.

Much of the Central Valley still lacks 100-year-flood protection, and many of the rural areas have levees that are only rated for 50-year floods, said Joe Countryman, a retired U.S. Army Corps engineer who sits on the Central Valley Flood Protection Board.

After Hurricane Katrina, the Legislature in 2007 ordered California’s urban areas to be protected from a 200-year flood. Levee upgrades and other flood-protection improvements are underway to meet that goal in Sacramento, but they’re still years away from completion.

When finished, the upgrades should prove more than adequate to protect Sacramento from the largest floods ever recorded, but the region’s flood protection system still wouldn’t withstand a storm like Harvey, Countryman said.

“If it happens, there’s going to be devastation,” he said. “If we get a 500-year flood on the American River, there’s going to be huge amount of damage in Sacramento.”

Before Houston’s floods, the Sacramento region was often described as the U.S. metropolitan area at second-greatest risk of a devastating flood, after New Orleans.

A 2015 federal study declared California’s risk of catastrophic flooding worse than any other region in the country – even the southern hurricane states.

The reason? The huge storms called atmospheric riversthat often strike California in the winter.

Sometimes called “horizontal hurricanes,” atmospheric rivers can bring as much water as a major tropical storm. An atmospheric river forms as high-powered winds drag a fire hose of tropical moisture across the Pacific Ocean, pointing directly at California for days on end. The state got a potent taste of the phenomenon this winter as storm after storm battered the region in what became the wettest winter on record in Northern California.

Climate change is expected to increase the risk of flooding across the Central Valley, experts say. In a warmer climate, the Sierra will see more rain instead of snow, which means more water gushing down from the mountains to the Central Valley when atmospheric rivers hit.

That doesn’t bode well for Sacramento, which, like Houston, was built in a naturally swampy area that Mother Nature wants to flood during powerful storms.

The American and Sacramento rivers that converge in Sacramento were once part of a massive Central Valley river system that dramatically shrank and swelled with the seasons.

Before European settlement, much of the Central Valley would flood and become swampland during the winter, forming what historians describe as a vast inland sea. These marshes would recede or outright dry up during the valley’s blast-furnace summers.

Because rivers were used for shipping and commerce, European settlers built cities along key river confluences. It’s why cities such as Sacramento, West Sacramento, Yuba City, Marysville and Stockton are now sitting in some of California’s most flood-prone areas.

To try to tame the inland sea, engineers over the decades built towering upstream dams to catch stormwater, and they lined the rivers below them with massive earthen levees. The embankments effectively turned meandering river channels into large drainage ditches that funnel stormwater away from cities and shunt it out to the Pacific.

Sacramento Valley cities also are protected by the Yolo and Sutter bypasses, miles of farm fields buttressed by levees. In heavy storms, the fields within the bypasses are flooded, serving as a sort of check valve to keep swollen rivers from over-topping the levees that protect urban centers.

The system largely worked as intended this year, a remarkable feat considering the record-breaking precipitation totals, and the fact that one of the region’s key pieces of flood-control infrastructure – the massive Oroville Dam along the Feather River – was badly damaged when a crater formed in its spillway.

Only a few places experienced flooding, mostly as small, undammed creeks or tributaries spilled their banks.

“I think we did amazingly well this last winter, given it was the wettest year on record for Northern California and particularly given the problems at Oroville, but it is easily possible to have worse storms,” said Jay Lund, executive director of the Center for Watershed Sciences at UC Davis.

You don’t have to go back very far to envision what “worse” might mean.

The last major Northern California flood, in January 1997, killed eight people and caused $1.8 billion in damage. Some of the most damaging flooding occurred as levees broke in Yuba County along the Feather River, which merges with the Sacramento River just north of the city of Sacramento.

Eleven years earlier, a levee failure – also in Yuba County – destroyed nearly 3,000 buildings and killed two people. Across Northern California, the 1986 flooding killed 13, forced 50,000 people to evacuate and did $400 million in property damage.

Sacramento narrowly avoided a crisis of Harvey-like proportions that same year. A levee along the American River nearly failed in Sacramento’s River Park neighborhood. Had that happened, flooding across Sacramento would have been extensive.

Engineers upgraded levees along the Sacramento and American rivers and south-county streams, and they addressed problems in such vulnerable areas as Arcade Creek, the Pocket and Natomas. Federal dam operators also built a new spillway at Folsom Lake that will enable reservoir operators to release more water into the American River as big storms approach, leaving more space in the lake to catch storm runoff.

But there are still $2.4 billion worth of flood-control projects that need to get finished to bring the Sacramento region into 200-year flood protection.

They include plans to beef up the Yolo Bypass, to address lingering levee problems on the major rivers and to complete repairs to the levees ringing the Natomas Basin, whose vulnerabilities prompted the city to halt new construction from 2008 to 2015.

The Army Corps of Engineers started upgrades on 24 miles of levees this year in the Natomas area, and engineers have embarked on a $375 million project that would add a layer of rocky erosion protection along up to 11 miles of the lower American River to prevent a scenario like what happened in 1986.

Officials say it will take several years to complete the projects.

To protect communities along the Feather River where levees broke in 1986 and 1997, around $500 million has been spent on repairs to dozens of miles of levees since 2007. Millions of more dollars in upgrades are underway or planned.

Experts, such as Mount of the Public Policy Institute of California, say that the upgrades are smart investments, even though they’ll never bring complete protection.

“All those improvements don’t eliminate flooding,” Mount said. “They just make it less frequent.”

Mount said people living in flood plains are always gambling that a megastorm won’t overpower a region’s defenses.

“You roll the dice every year,” Mount said. “In Houston, the die came up snake eyes.”

On Aug. 27, the Sacramento Fire Department sent a team of 14 swift water rescue officers from their Urban Search and Rescue Team to Hurricane Harvey. The crews will drive 2,000 miles to Texas to help with the rescue efforts during the intense flooding caused by the storm. Sacramento Fire Department