In the vastness of the known universe, few things are more wondrous than a magnetar. These stars are deceptively pint-sized; they squeeze multiple suns’ worth of mass into an orb no bigger than a city. And they boast mind-bogglingly powerful magnetic fields that are trillions of times stronger than the one that encompasses our planet. A magnetar’s magnetic field is so strong, in fact, that it can crack open the star’s surface to release powerful bursts of energy that may be visible across billions of light-years. Despite these amazing properties, astronomers aren’t quite sure how magnetars form, with a myriad of possibilities on the table. “We have too many ideas, and we’re not sure which ones are right,” says Christopher White of the Flatiron Institute in New York City. Now researchers may have pinned down one possible pathway to a magnetar by finding an unusually massive and magnetic star that might be on the cusp of forming one of these enigmatic objects.

Tomer Shenar of the University of Amsterdam and his colleagues studied a pair of stars about 3,000 light-years from Earth that are collectively called HD 45166. One member of the pair had previously been identified as a Wolf-Rayet star—a very rare, hot and massive star in the final stages of its life. Such stars have exhausted their hydrogen fuel and instead burn helium, which makes them shine brighter and raises intense stellar winds that can blow off their outer layers. Studying the star in more detail, Shenar’s team discovered this was a particularly unusual Wolf-Rayet star with a magnetic field of 43,000 gauss. (Earth’s field, for comparison, is a paltry half-gauss, and our sun’s is just a single gauss.) This makes the star, whose mass is twice that of our sun, the most magnetic massive star ever discovered. “We have never detected magnetic fields in these types of stars,” Shenar says. “It turned out to have an extremely powerful magnetic field, and it is a prime candidate for becoming a magnetar.” The research was published today in Science.

Using the Canada-France-Hawaii Telescope on Mauna Kea in Hawaii—along with data from Brazil’s National Laboratory for Astrophysics, La Silla Observatory in Chile and the Roque de los Muchachos Observatory in Spain’s Canary Islands—Shenar’s team studied the star via a process called Zeeman-Doppler imaging, which can tease out details of a stellar magnetic field from subtle changes the magnetism imparts to the polarization of a star’s light. The researchers then modeled the Wolf-Rayet star’s history to better understand how its remarkable magnetic field might have formed and found that the star was likely the result of two helium-rich stars merging together. “We think it was quite a complicated merger,” Shenar says—one that possibly involved a helium-rich lower mass star spiraling into the puffy stellar atmosphere of an accompanying red supergiant. The rapid rotation of the two progenitors in the merging process would have spun up the postmerger star’s magnetic field, “amplifying it to a high degree,” says Lidia Oskinova of the University of Potsdam in Germany, who is a co-author of the new paper. “This is a new type of object,” she says.

Magnetars—only about 30 of which are known in our galaxy—are a type of neutron star, a remnant core that is left behind after a massive star ends its life. Neutron stars are the closing phase of stellar evolution, the “last stop” that dying massive stars can reach if they aren’t sufficiently hefty to collapse further to form a black hole. Many are born via a supernova—such neutron stars are created when a star’s explosive death leaves behind a dense, compressed core that is barely 10 miles across. That extreme compression—and an associated boost to the core’s rotation that leaves it spinning around several dozens of times per second—can in principle supercharge any preexisting magnetic field to reach the levels measured for magnetars: some 100 trillion gauss.

That is a magnetic field so strong that it can distort the orbits of electrons in atoms; hydrogen, for example, is squashed some 200 times narrower in a magnetar’s field. If such a magnetar were placed in the moon’s orbit around Earth, it would wipe most credit cards and hard disk drives on the planet. If you were to approach within 600 miles of a magnetar, the very atoms in your body would become so warped that your basic biochemistry would break down—to your immediate doom. Even the magnetar itself struggles in the grip of this field. “The magnetic field can create so much stress that it’ll crack the crust of the star,” says Jason Hessels of the University of Amsterdam, “causing a massive star quake that releases a lot of energy.”

Based on their modeling, Shenar and his team propose that a few million years from now HD 45166’s abnormally magnetic Wolf-Rayet star will end its life in a neutron-star-forming supernova, giving rise to a brand-new magnetar. But other experts are not yet convinced. Cole Miller of the University of Maryland says that while the measurement of the Wolf-Rayet star’s magnetic field “seems solid,” he isn’t completely certain the star will become a neutron star. Because of their powerful stellar winds, Wolf-Rayet stars usually lose a lot of their mass before expiring. But if the one in HD 45166 doesn’t lose enough mass, it “might become a black hole rather than a neutron star,” he says. If enough mass is lost, however, the creation of a magnetar would be “almost inevitable,” White says. “The magnetic field can’t just disappear. It has to be amplified when you collapse to the size of a neutron star.”

Astronomers have not yet managed to measure the magnetic fields of many neutron stars, but theoretical calculations suggest somewhere between 10 and 40 percent of them may be magnetars. Why some neutron stars develop ultrastrong magnetic fields and others do not is an open question. The case of the Wolf-Rayet star in HD 45166 is thought to be a particularly unusual one and not representative of a path all magnetars will follow. Magnetars may also arise from merging neutron stars, or from a neutron star that is spun up by an especially closely orbiting companion. “I would be a bit surprised if this was the only way to make magnetars,” Hessels says. But it provides us with one important datapoint in our understanding of how magnetars form, perhaps allowing other similar Wolf-Rayet stars to be found. “This is the best example of the direct progenitor of a magnetar so far,” says Gregg Wade of the Royal Military College of Canada in Ontario, who is a co-author of the new paper.

Magnetars are also thought to be the cause of some fast radio bursts (FRBs), powerful but brief eruptions of radio waves that observers have found emanating from mysterious sources scattered across the universe. How magnetars might produce FRBs is uncertain, yet systems like HD 45166 could offer useful clues for solving the puzzle. “We have at least one case where an FRB source might be in a binary system,” Hessels says, noting a potential linkage between the phenomenon and systems like HD 45166.

Unfortunately, a few million years is far too long for anyone to wait to personally see whether and how HD 45166’s weird star gives birth to a magnetar. But this case does establish a possible pathway to these awesome bodies—and our deeper understanding of them. Nobody has “been able to explain why magnetars are the strongest magnets in the universe,” Wade says. Now we might know how one of them will be created.