A massive solar storm that could have caused widespread power outages and disabled “everything that plugs into a wall socket” nearly hit the Earth two years ago – and most of us had no idea.

NASA recapped the solar “superstorm” of July 2012 in a post on its science news website this week, saying it could have significantly disrupted life on the planet.

The near-miss was described in the December 2013 issue of the journal Space Weather and also discussed in another publication in March. But the magnitude of the solar threat seems to be just sinking in now, after NASA posted another summary of the July 23, 2012 event.

That day, what’s known as a coronal mass ejection -- a huge cloud of plasma exploding from the Sun -- blew across the Earth’s orbital path. Luckily, our planet was out of the way.

But if the solar flare had occurred a week earlier, Earth would have been “in the line of fire,” according to the University of Colorado’s Daniel Baker, who co-authored the study published in Space Weather.

"If it had hit, we would still be picking up the pieces," Baker said in the NASA post.

"I have come away from our recent studies more convinced than ever that Earth and its inhabitants were incredibly fortunate that the 2012 eruption happened when it did.”

NASA describes it as the most powerful solar storm in as many as 150 years, capable of causing more than $2 trillion in damages across the globe.

Scientists were able to accurately analyze the effects of the storm because it hit a solar observatory in space called STEREO-A.

The space agency said an extreme solar storm begins with a solar flare. Such flares produce X-rays and extreme UV radiation that can reach Earth at light speed, causing radio blackouts and GPS disruptions.

That would be followed by electrons and protons that can damage satellites. Then, the effects of the coronal mass ejection would cause massive damage to electronics and the electrical grid on Earth, in the case of a direct hit.

“Analysts believe that a direct hit by an extreme CME such as the one that missed Earth in July 2012 could cause widespread power blackouts, disabling everything that plugs into a wall socket,” NASA said.  “Most people wouldn't even be able to flush their toilet because urban water supplies largely rely on electric pumps.”

NASA scientists believe that the 2012 solar storm was as powerful as the so-called Carrington Event of 1859, named after English astronomer Richard Carrington. That solar event produced Northern Lights as far south as Cuba and caused telegraph lines to spark, even setting fire to some telegraph offices.

We may have escaped a catastrophe two years ago, but another major solar event could be heading our way in the coming years.

According to one physicist’s calculations, there is a 12 per cent chance that a “Carrington-class storm” will hit the Earth in the next decade.