Just after midnight, during the peak of last week's 7.8 magnitude earthquake in New Zealand, residents stirred from sleep were stunned to see the sky alight with flickers of blue, green and white.

"The lights happened right on the peak of the shaking ... [There were] of colors mainly green and blue and white, but a bit of yellow and other color was there too," Zachary Bell told ABC News Australia. Bell uploaded the clip you see below of the light show.

While many people initially assumed the lights were the result of power line transformers exploding from the quake, the video shows the event happening far off the coast. Lightning has also been ruled out because there were no storms in the area at the time. What residents witnessed were "earthquake lights," a still-unexplained natural phenomena that has been reported over the centuries. The lights appear while the ground is shaking and before it begins.

"In the past, people often interpreted [earthquake lights] in religious terms, and in modern times they thought of UFOs, although there is a completely rational physical explanation that we are working on," Friedemann Freund, an adjunct professor of physics at San Jose State University, told National Geographic in 2014.

Freund co-authored a paper published in GeoScienceWorld that recorded more than 65 examples of earthquake lights stretching back to the year 1600. These include observations of a faint rainbow of light before the great 1906 quake in San Francisco, four-inch flames of light flickering above a stone street before the 2009 quake in L'Aquila, Italy, and flashes of light in the night sky during the Pisco, Peru Earthquake of 2007. Another example of the New Zealand lights can be seen in the video below.

In their paper, Freund and his colleagues theorize that earthquake lights are the result of a certain type of rock producing electrical charges under great stress. "The charges can combine and form a kind of plasma-like state, which can travel at very high velocities and burst out at the surface to make electric discharges in the air," he added.

But what about the aurora-esque light show observed high above New Zealand? Scientists speculate this kind of earthquake light is the result of Earth's magnetic field becoming disrupted from the quake and briefly glowing under the stress.

Unfortunately, earthquake lights are not a reliable warning mechanism, as the natural phenomena only occurs in less than 0.5 percent of earthquakes worldwide. That said, if you do happen to see some unexplained flashes and live in a region prone to big quakes, it might be a good idea to take a walk outside.

"If we see two, three, or four characteristic phenomena, then it looks like there might be an earthquake," Freund said. "If they are observed, let's watch out."