A massive, magnetic star abruptly burst and vomited out as much energy as a billion suns - and it happened in a fraction of a second, scientists recently reported.

This type of star, known as a magnetar, is a neutron star with an extraordinarily strong magnetic field, and magnetars often flare spectacularly and without warning. Despite the fact that magnetars can be thousands of times brighter than our sun, their eruptions are so short and unexpected that astrophysicists find and research them difficult.

Researchers were able to capture one of these flares and quantify oscillations in the brightness of a magnetar as it erupted recently. According to a statement translated from Spanish, the scientists discovered that the faraway magnetar discharged as much energy as our sun releases in 100,000 years in just 1/10 of a second.

When a huge star collapses towards the conclusion of its life, a neutron star forms. In a supernova, protons and electrons in the star's core are crushed into a compacted solar mass that, according to NASA, combines extreme gravity with high-speed rotation and powerful magnetic forces. A neutron star is the consequence of cramming 1.3 to 2.5 solar masses into a sphere with a diameter of just 12 miles (20 kilometers). One solar mass equals the mass of our sun, or around 330,000 Earths.

NASA says matter in neutron stars is so densely packed that a sugar cube the size of a neutron star would weigh more than 1 billion tons, and a neutron star's gravitational pull is so strong that a passing marshmallow would hit the star's surface with the force of 1,000 hydrogen bombs.

Magnetars are neutron stars with magnetic fields 1,000 times stronger than regular neutron stars and more powerful than any other magnetic object in the cosmos. Even when they aren't erupting, our sun pales in comparison to these bright, dense stars, according to study lead author Alberto J. Castro-Tirado, a research professor with the Institute for Astrophysics of Andalucía at the Spanish Research Council.

"Even in an inactive state, magnetars can be 100,000 times more luminous than our sun," Castro-Tirado said. "But in the case of the flash that we have studied - GRB2001415 - the energy that was released is equivalent to that which our sun radiates in 100,000 years."

This is the most remote magnetar flare seen to date, with just about 30 magnetars found from approximately 3,000 known neutron stars.