Every so often, neutron stars do something really, really weird. The rate of their rotation abruptly changes. This is called glitching, and we don't know what causes it - but now astronomers have observed it for the first time using a radio telescope.

The neutron star is called the Vela Pulsar, about 1,000 light-years from Earth, and it's a serial glitcher. It was actually the first glitching neutron star ever identified, back in 1969.

Since then, many glitches have been observed - although never before with a radio telescope.

This is a big deal, because radio telescope observations have been able to tell us about the interior dynamics of the Vela Pulsar as it glitched.

Waiting for the glitch, the research team monitored the star for four years with the Mount Pleasant Radio Observatory in Tasmania and the Ceduna Observatory in South Australia.

"We knew a glitch happens about every three years, but like an earthquake, no one can predict one," said lead researcher Jim Palfreyman, a PhD candidate and astrophysicist at the University of Tasmania in Australia.

"We knew that if we could capture the glitch and the individual pulses, it would provide us a wealth of information, including how matter behaves at extreme temperatures and pressures."

Neutron stars are what's left of the collapsed core of a star after it goes supernova - if that star is below a certain mass.

In turn, pulsars are highly magnetised neutron stars with an extraordinarily fast spin rate, which emit jets of electromagnetic radiation as they spin.

If these jets are lined up correctly, spinning so the radiation flashes at Earth, we can see it - like a cosmic lighthouse.

Over time, these pulses slow down as the star loses energy. But glitching pulsars do a sort of hiccup, suddenly increasing in speed before gradually slowing back down to a rotation rate close to what was observed before the glitch.

In the case of the Vela Pulsar, that's about 11 rotations per second.

But what causes the pulsars to glitch is a mystery. One hypothesis is stress between the neutron star's rigid outer crust and its superfluid core as its spin rate slows, causing it to change shape and resulting in starquakes.

Another is that billions of sub-surface vortices in the superfluid that connect the core to the crust become unpinned and displaced, causing the neutron star to speed up.

And the team's data has turned out to be consistent with this hypothesis. They gathered 640MB every 10 seconds for 19 hours a day, most days of the four years, 3 petabytes in total.

The Vela Pulsar is just 20 kilometres (12.42 miles) across, but has the mass of about one-and-a-half Suns. Its density is immense. And until now, we'd only been able to see the exterior of neutron stars, the researchers said.

"This is the first time we have been able to get an indication of what's happening in the core," said astrophysicist John Dickey.

The glitch caused the pulsar to "null", or skip a pulse, indicating that its magnetosphere was disrupted. It also took, in total, around five seconds - faster than the team had expected.

"The way the glitch occurs is quite complex where the superfluid core of the star spins separately from the hard crust on the outside," Palfreyman explained.

"Then after about three years the core grabs the crust, which is slowing down, and speeds it up, causing the glitch to occur.

"By capturing the glitch, and the individual pulses, it helps us to better understand the 'equation of state' - which is how matter behaves in different environments."

This information might be able to help scientists build machines that need to operate under extremely high pressures and temperatures - fusion reactors, for instance.

The team's research has been published in the journal Nature.