Astronomers recently caught the grisly sight of an exoplanet being devoured by its star, in a preview of what will eventually happen to the Earth. The sun-like star is located within our galaxy, around 12,000 light-years away, and has puffed up into an end-of-life state called a red giant. As it grows, it expands outward, which is how it was able to swallow the Jupiter-sized planet that had been in orbit around it.

The researchers were able to spot the event because of the distinctive brightening pattern of the star, which is similar to what we can expect will eventually happen to our sun. “We are seeing the future of the Earth,” said lead author of the research, Kishalay De of the Massachusetts Institute of Technology (MIT), in a statement. “If some other civilization was observing us from 10,000 light-years away while the sun was engulfing the Earth, they would see the sun suddenly brighten as it ejects some material, then form dust around it, before settling back to what it was.”

Astronomers using the Gemini South telescope in Chile, operated by NSF’s NOIRLab, have observed the first compelling evidence of a dying Sun-like star engulfing an exoplanet. The “smoking gun” of this event was seen in a long and low-energy outburst from the star — the telltale signature of a planet skimming along a star’s surface. This never-before-seen process may herald the ultimate fate of Earth when our own Sun nears the end of its life in about five billion years.

Observing this event, which is the first of its kind to be seen as it happened, required the use of several astronomy facilities. The initial bright flash, which was caused by the planet being pulled into the star’s atmosphere, was observed by the Zwicky Transient Facility at the Palomar Observatory in California. It watches the sky for brief, transient events. Then astronomers used data from the NASA’s Near-Earth Object Wide-field Infrared Survey Explorer mission to look at the event in the infrared, where they saw that the initial flash grew bright extremely quickly, but then only emitted a smaller amount of energy.

They also used the Keck Observatory and Gemini South telescope to observe the longeduration, low-energy event and confirm that the flash was indeed caused by the star swallowing the planet. This shows the kind of observations that are possible now that we have telescopes observing the sky for these brief events which can last just a few weeks.

“I think there’s something pretty remarkable about these results that speaks to the transience of our existence,” said co-author Ryan Lau. “After the billions of years that span the lifetime of our solar system, our own end stages will likely conclude in a final flash that lasts only a few months.”

The research is published in the journal Nature.