The true identity of a star that has baffled astronomers for more than 100 years has finally come to light.

HD 45166 is a dying Wolf-Rayet star around 3,000 light-years away. Like most stars in its class, it's rich in helium, and has a companion.

Yet HD 45166 also has some peculiar behaviors not seen in any other Wolf-Rayet star, with a higher than expected loss of mass and an unusual pattern to its winds.

Now, a team led by astronomer Tomer Shenar of the University of Amsterdam in the Netherlands has discovered that this peculiar beast has one incredibly powerful magnetic field, suggesting that when it finally pops its star clogs it will transform into something known as a magnetar.

The detection makes HD 45166 the first known magnetic Wolf-Rayet star, and it solves the problems previously associated with the binary, and fills in some of the gaps in our knowledge about how massive stars turn into the most magnetic objects in the Universe.

An artist's impression of the magnetic field found at HD 45166. (ESO/L. Calçada)

Wolf-Rayet stars are rare, but they can be some of the most spectacular stars in the Milky Way, reaching the end of the atomic fuel that feeds the fusion in their cores. They're very hot, very bright, and very low in hydrogen, but rich in carbon and nitrogen.

They also lose mass at a furious rate via stellar winds, destined to go supernova in a relatively short span of cosmic time. Sending their outer material into space, their core quickly collapses into a neutron star: an ultradense object just 20 kilometers across containing up to 2.4 times the mass of the Sun.

Magnetars are a type of neutron star, but with absolutely mind-boggling magnetic fields around 1,000 times more powerful than a normal neutron star's and a quadrillion times more powerful than Earth's.

How they get that way is unknown; models suggest that one way could be if the star already had the magnetic field prior to supernova and core collapse. The problem with this is that no detections had been made of a star at the end of its life with a magnetic field powerful enough.

This brings us back to HD 45166. Previous measurements of the binary had found the Wolf-Rayet star was rich in helium, around 4 times the mass of the Sun, and on a tight, 1.6-day orbit with a B-type star. These properties, however, are at odds with what we know about the evolution of binaries, and how stellar winds are launched.

"This star became a bit of an obsession of mine," Shenar says. "I remember having a Eureka moment while reading the literature: 'What if the star is magnetic?'"

So, Shenar and his colleagues took a new set of observations of the star, looking for evidence of a magnetic field. They found it, along with a new set of measurements that almost completely recharacterized the binary.

Firstly, HD 45166 has a magnetic field strength of 43,000 gauss – that's the most powerful magnetic field ever recorded in a massive star.

Secondly, the star is way less massive than we thought – only around 2 times the mass of the Sun.

Finally, the orbital period of the binary is a much larger 8,200 days, give or take. The 1.6-day periodicity previously detected is the result of internal oscillations in the B-type companion star.

An artist's impression of the magnetar HD 45166 is predicted to become. (NOIRLab/AURA/NSF/P. Marenfeld/M. Zamani)

How the Wolf-Rayet star got to its current situation is unknown; the team believes it could have formed from the merger of two smaller stars. That seems to be a fairly specific and possibly rare scenario, so there are likely other magnetar evolution paths out there.

As for where it's going, in just a few million years, HD 45166 is expected to go supernova. The collapsing core will contract around and concentrate the magnetic field, resulting in a magnetar with a field strength of around 100 trillion gauss.

We may not be around to see it, but the discovery gives us a new tool for understanding magnetar formation, and a baseline for looking for similar systems out there in the Universe.

"It is exciting to uncover a new type of astronomical object," says Shenar, "especially when it's been hiding in plain sight all along."

The research has been published in Science.