Astronomers have shed light on the mysterious origins of the fastest spinning stars known to science - millisecond pulsars.
Pulsars are dense, highly magnetised dead stars that emit radio waves along their magnetic poles.
These waves sweep around as the star rotates, a bit like lighthouse beams.
Writing in the journal Science, a team has worked out how millisecond pulsars might evolve from a type of binary star system which spews out X-rays.
The results show how old pulsars may start gathering matter from a companion star, emitting first X-rays and then radio pulses.
Observations taken over nine years, from 1998 to 2007, showed a pulsar collecting this mass in a disc, at the same time increasing its rotational speed.
The result uncovers a hitherto unseen step in the evolution of millisecond pulsars.
After collapsing into a neutron star following a supernova, pulsars tend to rotate quickly - every few hundredths of a second or so. But they often slow down with age, taking up to seconds for each rotation and eventually stopping altogether.
However, a small population of neutron stars has extremely fast rotation - every few thousandths of a second. These millisecond pulsars are the fastest-rotating stars we know of.
One well-known class of system that is bright in the X-ray part of the electromagnetic spectrum but emits no radio waves is known as a low-mass X-ray binary or LMXB.
These systems typically consist of a neutron star with a lighter "normal" star nearby. Astronomers had long hypothesised that LMXBs might be millisecond pulsars in the making.
The idea is that the neutron star steals gas - which blocks radio waves - from its neighbour.
The gas first swirls around the neutron star like water around a plughole, forming an "accretion disc" surrounding it. The momentum the gas carries as it comes to rest on the neutron star increases its rotation speed.
The theory proposes that once the gas runs out, the disc disappears and the pulsar sprays out its radio pulses at higher speeds.
Over the last decade, astronomers have discovered LMXBs that show an accretion disc stage, resulting in a rotating system that spits out X-ray pulses.
But no one had seen these systems emitting the radio wave pulses that characterise millisecond pulsars.
Blink of an eye
In a wide-field survey using the Green Bank Telescope in West Virginia, US, in 2007, the team spotted a millisecond pulsar 4,000 light-years away.
Looking back through prior observations, they found the same object had previously been imaged by the Very Large Array telescope and the Sloan Digital Sky Survey. However, these observations suggested a very different scenario.
In 2000, the object seemed to possess an accretion disc of matter pulled from its companion star.
By 2002, the disc had disappeared again. Then, the 2007 measurements showed it was a millisecond pulsar, spinning around every 1.7 thousandths of a second.
"It appears this thing has flipped from looking like an LMXB to looking like a pulsar, as it experienced an episode during which material pulled from the companion star formed an accretion disk around the neutron star," said co-author Scott Ransom of the National Radio Astronomy Observatory (NRAO).
"Later, that mass transfer stopped, the disc disappeared, and the pulsar emerged."
He told BBC News: "The system that we found was identified as a weird system based on older optical and X-ray observations."
"But no one put it together that it was going from an X-ray source into a radio millisecond pulsar until we found these radio pulsations."
Those radio pulses vary in intensity and can disappear altogether, Dr Ransom said.
The team assumes that, towards the end of the mass transfer, the companion star gave up the last of its mass in fits and starts, so that there was probably a patchy mess of gas surrounding the pulsar that interfered with its regular radio pulses as observed on Earth.
Dr Ransom said the team was exceptionally lucky to have caught the system in the midst of its transition from X-ray emitter to millisecond pulsar - through observations taken over the cosmic equivalent of the blink of an eye.
The researchers say the results provide convincing evidence that the millisecond pulsar formation theory is correct, and Dr Ransom says it has inspired a return to studying known LMXB systems to see if they are intermittently firing out radio pulses.
"So far we've been completely unsuccessful. But, who knows, next year one or more of those systems may stop donating gas completely and a radio pulsar pops on."