Our next-door neighbour is a cannibal. In its distant past, the Andromeda galaxy has devoured at least two other galaxies, subsuming their stars into its galactic halo. And now, for the first time, astronomers have identified those stars, tracking them to individual galactic mergers billions of years ago.

It shouldn't come as a tremendous surprise. Our own Milky Way shows traces of the same greedy behaviour, more than once; previous evidence in the past has also hinted at Andromeda's galactically ravenous appetite.

But this is the first time that such direct lines of evidence have been used to establish multiple collision events in Andromeda's distant past.

"We have been working to chart out the stellar debris of these smaller galaxies after they are destroyed. As we build up a picture of the stuff in the halo, we can compare to our theoretical models so see if we really understand how galaxies form," astrophysicist Geraint Lewis of the University of Sydney told ScienceAlert.

"We set out to look for historic collisions, but we didn't expect to see quite the signature that we found."

That signature was found in dense, spherical clumps of stars known as globular clusters that tend to hang out in the haloes of large galaxies - the sphere of gravitational influence that extends above and below the relatively flat orbital plane.

Andromeda is roughly 2.5 million light-years from the Milky Way. Resolving the motions of globular clusters from that distance is no easy task.

Cue the Pan-Andromeda Archaeological Survey; for years, it has been taking observations of Andromeda using the Canada-France-Hawaii telescope in Mauna Kea.

(Mackey et al., Nature, 2019)

With these deep observations, the team was able to discern individual globular clusters in Andromeda's halo. Then, larger telescopes - the Gemini Observatory and the WM Keck Observatory - revealed the motion of these clusters within the halo.

Two distinct groups of the clusters were orbiting in ways that would have been very, very unusual if they had formed within said halo. This suggested that they were absorbed from elsewhere.

By tracing those orbits and extrapolating them back through time, the team was able to determine where these clusters may have come from. The answer indicates two distinct collision events: one between 7 and 10 billion years ago, and the other within the last few billion years.

In a paper published last year, simulations suggested that Andromeda merged with a massive galaxy some 2 billion years ago; this is the first study that shows evidence of Andromeda cannibalising other galaxies, based directly on the motion of globular clusters.

And the new research is a little more conservative about the size of Andromeda's meals.

"The galaxies that were consumed were smaller than Andromeda - possibly even a group of dwarf galaxies, but their total mass was considerably less than the hundreds of billions of stars in Andromeda," Lewis said.

"[Determining their] age is a trickier thing, as Andromeda is built of these things and it's been around for 10 billion years or so. There are old stars in both, as well as younger stars that formed more recently."

But there are other mysteries afoot, too. The orbits of the clusters suggested that the two dwarf galaxies had come from completely different directions.

And the apparent alignment between the destroyed galaxies and the bizarre present-day alignment of satellite dwarf galaxies around Andromeda suggests that the cannibalised dwarf galaxies were fed into Andromeda along the cosmic web, a vast network of filaments connecting intergalactic space.

It's a curious finding, and the researchers are yet to determine how it fits in with our models of galactic evolution.

"We have to work out whether this signature of two distinct accretion events is something we expect in our theories or not," Lewis told ScienceAlert.

"I'm sure this will spark new research in this area as people try to find out if our results are in line with expectations, or is there something missing in the physics of galaxy evolution (or even in our knowledge of physics)."

But don't worry - one thing hasn't changed. Andromeda and the Milky Way are still on a collision course for sometime in the next few billion years (although the exact timeline may still have a few kinks).

Determining how many galaxies Andromeda has gobbled up, and how big they were, could help us figure out which galaxy will emerge victorious, even if we're no longer around to see it.

The team's research has been published in Nature.