Newt Gingrich, a former speaker of the House and a Republican candidate for president, lives in McLean with his wife, Callista.

Callista and I live in the Virginia suburbs of Washington, and, like many in the region, we lost power in the recent storms. The blackout, combined with a record heat wave, made homes nearly uninhabitable. The storm and heat were this region’s greater leveler: Rich or poor, urban or suburban, six-figure income or just barely getting by, we were all cast on the same strange shores.

Without power, the comforts of home become worthless. You sit in the sweltering heat, realizing you are living in a box that, without electricity, is a trap. You pray for the “juice” to return before your groceries go bad. You either make do in the heat or find refuge with friends who have electricity.

I write this now because of my concern for national security and our power grid, which are susceptible to doomsday-level damage if hit by an electromagnetic pulse (EMP) strike or a major solar storm.

It is almost unthinkable, yet possible, that an enemy could detonate a nuclear weapon over the atmosphere over the continental United States, triggering an electromagnetic pulse. This would short-circuit our power grid, taking power off­line for months, perhaps even years.

A similar crisis could be sparked by a solar storm like the Carrington Event of 1859, a type of geomagnetic disturbance that occurs about every 75 years. Statistically, we are long overdue for such a storm. There have been some recent examples of the potential impact, such as the millions in Quebec who lost power for several hours in 1989 as a result of a space storm.

Our nation’s communications infrastructure, modes of transportation and many fundamentals of survival all rely on a power grid that is vulnerable. The current system lacks safety features needed to prevent damage to critical electrical infrastructure.

In 2009, my friend — and sometimes co-author — William R. Forstchen published a truly frightening book, “One Second After.” (I wrote the foreword.) The story is fiction but based on hard facts. It is a cautionary tale about the threat of EMP strikes and major solar storms, known as coronal mass ejections.

William turned to bipartisan congressional studies published in 2004 and 2008 and interviewed many experts. His book made the New York Times bestseller list and helped to trigger what some call the “prepper” movement.

During the recent power outage, William and I talked about what would have happened if this had been an EMP attack or a strong solar storm.

Suppose that, rather than being a temporary disruption in our lives, the power outage lasted weeks or months, or even years. Consider what state all of us, from the richest to the poorest, would be in if we were still literally in the dark. Millions could be trapped in houses or apartments that were never designed for this climate without air conditioning. No cool air; months with no food shipments and every pharmacy shut down — no refills for life-sustaining medications.

In a crisis, many in the Washington area could not even flee because the impact of an EMP attack would disable most cars and public transportation. The water supply would go dry without electricity to pump water from rivers and wells.

Imagine if you could find a bottle of potable water for, say, your children. How much would you pay? What would you pay with if every bank and ATM were shut down?

Public safety? Forget it. No power means no police cars, no communications and no 911 emergency service. For criminals, it would be time to run rampant.

Could such a scenario be in our nation’s future? It might, if we do not learn from this experience. Preparation begins with demanding that our governments — local, state and federal — prepare as well.

The technology exists to harden at least part of the national electric grid against an EMP attack or major solar storm. Two years ago, in a time of political deadlock, the House approved the Grid Reliability and Infrastructure Defense Act with bipartisan support. It would put in place protections such as fortified bunkers for the national power grid — but this effort stalled in the Senate.

I challenge the president and Congress to picture what it would be like if the power in the nation’s capital were still off — or, far worse, if the entire nation were without power for months.

I asked William what he thought of the recent outage. He said: “Maybe it will wake up those on Capitol Hill and the White House that we just had a taste of a nightmare future, if we do not prepare now.”

I second his motion.

The region’s power has been restored. The air conditioning hums, and our food and medicines are safe. We think life is back to normal. But what if this had been more than a brief interruption?