Remember the classic “Trek” episode, “By Any Other Name” where Captain Kirk had to fend off an alien invasion by a group from the Andromeda galaxy?

Well, it may be that our fictional hero was on to something. No, our galaxy hasn’t been invaded by aliens from Andromeda. But a new study of the Andromeda galaxy reveals that it’s a cannibal.

And that it’s eventually headed our way.

Astronomers have long suspected Andromeda of being a space predator, consuming dwarf galaxies that wander too close. Now, cosmic detectives are doing a massive search of the neighborhood and have found proof of Andromeda’s sordid past: They’ve spotted leftovers in Andromeda’s wake.

Early results of a massive telescope scan of Andromeda and its surroundings found about half a dozen remnants of Andromeda’s galactic appetite. Stars and dwarf galaxies that got too close to Andromeda were ripped from their usual surroundings.

“What we’re seeing right now are the signs of cannibalism,” said study lead author Alan McConnachie of the Herzberg Institute of Astrophysics in Victoria, British Columbia. “We’re finding things that have been destroyed … partly digested remains.”

Their report is published in Thursday’s edition of the journal Nature.

Andromeda and our Milky Way are the two big dogs of our galactic neighborhood. Andromeda is the closest major galaxy to us, about 2.5 million light years away. A light year is about 5.9 trillion miles. The massive mapping of Andromeda is looking half a million light years around Andromeda.

Astronomers have known for decades that galaxies consume each other, sometimes violently, sometimes just creating new mega-galaxies. But this study is different because “of the scale of the cannibalism and we’ve found evidence directly in front of our eyes,” said co-author Mike Irwin, an astrophysicist at the University of Cambridge in England.

This type of galactic crash is common and the paper makes sense, said Harvard astronomer Mark Reid, who wasn’t part of the Andromeda mapping team. And just because Andromeda consumes a galaxy, it doesn’t make it disappear, he added.

The cannibalism often just strips stars from where they had been, rearranging the night sky. Most of a galaxy is empty space, so there is little if any crashing of stars and planets going on, Irwin said.

“It would be a beautiful night sky,” he said. “It would be quite spectacular.”

The once and future main victim of Andromeda is a dwarf galaxy that circles it called Triangulum.

Eventually, in about 3 billion years, Triangulam, which once came too close to Andromeda and was stripped of some stars, will spiral into Andromeda, about the same time it comes crashing into our galaxy, said study co-author John Dubinksi of the University of Toronto.

The Milky Way and Andromeda are heading toward each other at about 75 miles per second. They are so far away from each other that the big crash is a few billion years away. And even that might be nothing more than a reshuffling of the night sky or the creation of one super-sized galaxy, McConnachie said.