Early Sunday morning, all of mainland Argentina lost power in an “unprecedented” blackout event that left most of the country’s 44 million citizens in the dark until the evening. The blackout also extended to Uruguay (which is connected to Argentina’s power grid) and limited parts of Chile. Although the exact cause of the blackout is still being investigated, Argentina experienced heavy rains over the weekend, and there is reason to believe that the inclement weather played a starring role in the largest blackout in recent history.

Extreme weather events are a leading cause of blackouts around the world, and the blackout in Argentina is a reminder that our electric grids aren’t ready to handle the increasing intensity of storms resulting from climate change. Although the United States isn’t likely to see a nationwide blackout like the one that hit Argentina, localized blackouts in the United States have increased in both frequency and duration in recent years. This is due in no small part to massive forest fires, snow storms, tornadoes, and hurricanes that cause localized blackouts often affecting tens of thousands of people.

“There is clear evidence that extreme weather events have increased over the past 20 years, and so have the number of outages and the number of customer hours out of service,” says Alison Silverstein, an independent energy consultant and previous advisor to the chairman of the Federal Energy Regulatory Commission. “We need to accept this and do a better job at helping customers and communities survive these growing outages and threats.”

Modern electric grids are designed like a web, which helps isolate blackouts as much as possible. If a high-voltage line between generation stations goes down power can be rerouted through other pathways. But as Silverstein points out, the vast majority of blackouts Americans experience are due to failure in distribution networks, the “last mile” in the electric grid, not failures at generation stations or the transmission lines. While the transmission system is web-like, the distribution system is designed like a tree. This means that if a failure occurs at any one of the nodes in the tree this can disrupt the rest of the local distribution system.

“Extreme weather events are becoming much worse and there are more of them,” Silverstein says. “We need to be planning the distribution system and modifying recovery processes to deal with those things, not just wringing our hands and acting like this is normal. What is ‘normal’ has changed and it’s getting worse.”

The United States got a taste of massive grid failure in 2003, when an overgrown tree in Ohio tripped a transmission line and a software bug failed to alert the utility. This mundane event triggered a series of failures that left 55 million people in the northeast without power for several hours, with some areas waiting days for the lights to go back on. The economic cost of the blackout was estimated to be about $6 billion, and it contributed to the deaths of at least 11 people. In the aftermath, the US government enacted a number of policies designed to prevent blackouts of this magnitude from happening again.

Those reforms have helped make widespread blackouts of the type seen in Argentina exceptionally rare in the United States, says Ross Baldick, a professor of electrical and computer engineering at the University of Texas, Austin. He says resilience against these types of events is also baked into the design of the US grid at the transmission and generation layer. For example, the operators of modern grids adhere to an “N-1” standard, which means that the system operates normally following an outage of a single generation station or transmission line (the ‘N’) by routing around the crippled entity.

Even in the event of multiple transmission failures, grid operators can perform controlled shutdowns of the grid to prevent further damage from overloaded transmission lines and confine the extent of the outage. Furthermore, the US grid is divided into three major regional grids—the Eastern, Western, and Texas interconnections. If one of the regional grids was knocked offline, Baldick says the other two grids would have enough capacity to keep functioning.

In other words, the only way the entire US grid or even an entire interconnection is going down is through cyberwarfare, a coordinated attack on key infrastructure points, or via the Trump administration’s favorite energy bogeyman, electromagnetic pulses. Each of these scenarios is relatively unlikely to occur. The US ramped up cybersecurity for its energy infrastructure after it became clear it was being targeted by foreign hackers, physical security at key transmission sites and generating stations has been bolstered post-2003, and the grid can probably survive an EMP just fine.

This means that the key to energy security in the United States is less about the bulk power system and more about hardening the grid at the level of local distribution. Silverstein says that many electric customers, utilities, and policy makers are already taking steps to make the distribution system more resilient, like operating microgrids or having onsite energy generation and storage. But there’s still more to be done. Planning distribution networks to incorporate more smart microgrids and switches between local networks will make it easier to survive a blackout and restore power; building energy efficient buildings will reduce strain on the grid; moving equipment out of current and future flood zones will decrease blackout times; or simply building tougher electric poles can all contribute to decreasing outages in the future.

So while America may not face a threat of large-scale blackout anytime soon, there is little doubt Americans will see increasing localized blackouts in the future. The time to start planning for this eventuality is now, before the lights go out.

This story originally appeared on wired.com.