Astronomers have figured out how to make the universe’s most powerful magnet. All you need is two massive stars orbiting close to each other so that one swipes gas from the other, causing the thief to spin so quickly that its magnetic field dwarfs that of Earth by 100 trillion-fold. The finding offers fresh insight into how some of the galaxy's smallest but most extraordinary stars arise.

Magnetars are a special breed of pulsars, which are fast-spinning neutron stars that form when a massive star explodes as a supernova: The star's outer layers shoot off into space, while its core collapses to become the pulsar. Magnetars are as rare as they are extraordinary. Known pulsars number in the thousands; known magnetars, only a couple of dozen.

Astronomer Simon Clark of the Open University in Milton Keynes, U.K., and his colleagues observed a young star cluster named Westerlund 1, which sports one of the few known magnetars. The cluster is only 5 million years old and lies 16,000 light-years from Earth in Ara, a constellation just south of Scorpius.

The astronomers identified a peculiar blue supergiant—a star much hotter and more luminous than the sun—that they believe once orbited the star that later became the magnetar. Named Westerlund 1-5, the blue supergiant dumped large amounts of gas onto its partner, speeding up its spin the way falling water makes a water wheel twirl. As Clark's team reports online this week in Astronomy & Astrophysics, this spin-up amplified the star's magnetic field so that when it exploded and collapsed, it became a magnetar rather than an ordinary pulsar.

Furthermore, the blue supergiant saved its partner from a bleak fate. The premagnetar star was so massive that it should have collapsed into a black hole. But before it exploded, it began to expand, as aging stars do, and its partner grabbed enough gas back that the premagnetar star slimmed down, becoming a magnetar rather than a black hole. This removal of material also kept the premagnetar star spinning fast; normally, expanding stars spin more slowly, just as spinning ice skaters do when they extend their arms.

The evidence? First, the blue supergiant is racing away from the cluster, suggesting that another star recently kicked it away when it exploded. Second, the blue supergiant has odd abundances of carbon, nitrogen, and oxygen.

For most of their lives, blue stars generate energy via the CNO cycle, in which carbon, nitrogen, and oxygen serve as catalysts to convert hydrogen into helium. During the CNO cycle, carbon and oxygen gradually get transformed into nitrogen. Sure enough, the blue supergiant Westerlund 1-5 has lots of nitrogen and little oxygen. But it also has lots of carbon—which it shouldn't. Clark's team believes the star received this carbon recently, before the other star became the magnetar. Late in its life, that star burned helium into carbon, sprayed some of the carbon onto the blue supergiant's surface, and then exploded, so that the two stars went their separate ways.

"It's not a slam dunk, but it is a reasonable argument," says Bryan Gaensler, an astronomer at the University of Sydney in Australia who was not involved in the discovery. He notes that massive stars usually have companions, yet the magnetar and the blue supergiant are both single. Moreover, a pulsar is a magnetar for only the first 10,000 or so years of its life—and the carbon on the blue supergiant should survive for only about 10,000 years before it slips beneath the star's surface and out of sight. Thus, Gaensler says, each object had a partner recently, suggesting "they were each other's companion."

If the new work is correct, it explains the long-standing mystery of how a stellar corpse can acquire such an enormous magnetic field: At least some magnetars owe their superlative qualities to another star they booted away, a cosmic illustration of the dictum that no good deed goes unpunished.