How a Mysterious "Starquake" Rocked the Earth in 2004
Let us set the stage for you. It was 17 and a half years ago, on December 27th, 2004. Several satellites sat silently in orbit around Earth, monitoring emissions from deep space all across the electromagnetic spectrum. All of a sudden, something completely unexpected happened: They were bombarded by high-energy gamma rays and x-rays. Three different satellites — the Neil Gehrels Swift Observatory (Swift), the Reuven Ramaty High Energy Solar Spectroscopic Imager (RHESSI), and INTErnational Gamma-Ray Astrophysics Laboratory (INTERGAL) — all picked up on this massive blast of energy. So what was it? Where did it come from? What did it do to Earth? To answer those questions, we must first look at celestial objects called neutron stars and magnetars.
What Are Magnetars & How Are They Formed:
When a star more massive than our Sun — weighing anywhere from 8 to 30 solar masses — reaches the end of its life, it dies violently. It collapses in on itself and spits its outer layers of gas out into space in an event known as a supernova. The remainder of its mass is packed tightly together in a very dense, compact object known as a neutron star. Imagine an object just 10-miles (16 km) across, with a mass larger than the Sun. A mere teaspoon of neutron star material would weigh approximately 4 billion tons - more than the biggest mountain on Earth.

Neutron stars have intense magnetic fields. Some of them spin around on their axis very fast and emit regular pulses of electromagnetic radiation, including x-rays, gamma rays, radio waves, and light. These are pulsars, and if they are positioned in such a way that their poles are pointed towards Earth, they are detectable by our instruments. Magnetars are another type of neutron star, but are extremely rare. Only a handful of them are known to exist.
The manner in which these mysterious objects form is still a matter of debate amongst astronomers, but many believe these extremely magnetic objects — in fact, they are the most magnetic objects in the universe — may belong to double-star systems.
Meet CXOU J164710.2-455216:
Take one of the most well-known magnetars: It belongs to the Westerlund 1 star cluster, which is located about 16,000 light-years from Earth in the Ara constellation.
Known as CXOU J164710.2-455216: One of its biggest mysteries is why it became a magnetar instead of a black hole. It certainly defies our understanding, being that the star that preceded it likely weighed about 40 times more than the Sun before it died — way more massive than our models say should be possible for neutron star formation. One solution to the mystery suggests it was formed through the interactions of two stars tightly packed in a binary star system no larger than the distance between Earth and the Sun. No such star was found until the ESOs Very Large Telescope found a runaway star that could be the culprit.
The reason it was so elusive is that it was kicked out of the binary system after the star that became the magnetar went supernova.
“Not only does this star have the high velocity expected if it is recoiling from a supernova explosion, but the combination of its low mass, high luminosity, and carbon-rich composition appear impossible to replicate in a single star — a smoking gun that shows it must have originally formed with a binary companion,” notes Ben Ritchie, a co-author of the paper outlining the discovery.

It's believed that the less massive star siphoned material from its more massive counterpart as it neared the end of its life and started to run out of fuel. This material exchange resulted in the soon-to-be-magnetar spinning faster and faster, which strengthened its magnetic field dramatically. It also began to shed some of its gained material — losing some to space, and imparting some back to its companion.
“It is this process of swapping material that has imparted the unique chemical signature to Westerlund 1-5 and allowed the mass of its companion to shrink to low enough levels that a magnetar was born instead of a black hole — a game of stellar pass-the-parcel with cosmic consequences!” noted team member Francisco Najarro.
In this theory, magnetars likely form through a two-step process. They siphon material from their companion, which causes them to gain momentum and spin very quickly, thus generating their insanely strong magnetic fields, yet they transfer some of that material back, which is why they don't collapse into black holes. Now that we've gotten that out of the way, what exactly happened in 2004, and what does it have to do with magnetars?
Starquakes, Oh My!
As mentioned, magnetars have extremely strong magnetic fields. How strong you may ask? Well, they are quite possibly a quadrillion (that's 1,000,000,000,000,000) times stronger than Earth's magnetic field, which is strong enough to warp the magnetar's crust. The crust and magnetic field of the magnetar are intrinsically linked, and any fractures or disturbances of either cause the other to be affected.
NASA notes, "A fracture in the crust will lead to a reshuffling of the magnetic field, or a sudden reorganization of the magnetic field may instead crack the surface. Either way, the changes trigger a sudden release of stored energy via powerful bursts that vibrate the crust, a motion that becomes imprinted on the burst’s gamma-ray and X-ray signals."
One such event happened in an object known as SGR 1806-20, located around 50,000 light-years away from Earth. The light and energy reached Earth in the infamous event in 2004. In merely one-tenth of a second, the magnetar hit Earth with 10^40 watts of energy, which is more energy than the Sun produces in 150,000 YEARS.

Should the object have been located within 10 light-years of Earth, it would have severely affected our atmosphere - damaging our ozone layer to an unknown degree, and perhaps mimicking a nuclear explosion. As it were, the gamma-ray radiation it emitted pierced Earth's ionosphere and caused the atmosphere to temporarily become partially ionized. Moreover, powerful pulsations of energy from the starquake caused the ionosphere to expand and contract, which temporarily altered the shape of the ionosphere, knocked many satellites offline for a short time, and disrupted low-frequency radio communications.
Perhaps most interestingly, this distant celestial object managed to slightly shift Earth's magnetic field permanently. Not too terribly shocking considering, if we were to measure the starquake from the perspective of an Earthquake, it would register as a 32 magnitude earthquake on the Richter Scale.
Thankfully, the closest magnetars aren't very close at all. What's more, magnetars only retain their strong magnetic pulls for about 10,000 years before they weaken enough to be rendered ordinary neutron stars. Suffice to say, the odds of one wiping all life out on Earth is pretty slim, but that doesn't mean magnetars aren't terrifying forces of nature.