What just happened? When a mid-size star is about to complete its main life cycle, it runs out of the "fuel" needed to feed the nuclear fusion process at its core and starts expanding outward. If a planet is orbiting too close, it gets inevitably swallowed up by the swollen star. We know the physics behind this kind of event, and now astronomers think they have observed it in real time too.

At first sight, the event formally known as ZTF SLRN-2020 looked like a collapsed star (white dwarf) stripping out hot gas from a neighbor star. Kishalay De, an astronomer at the Massachusetts Institute of Technology and the lead author of a new study published in Nature, was searching for this kind of event by looking at observations made with the Zwicky Transient Facility (ZTF), an instrument based at Palomar Observatory in Southern California.

ZTF looks for cosmic events with brightness levels that change rapidly, sometimes in a matter of hours. When a white dwarf goes nova, it gets surrounded by flows of hot gas producing a bright flash of light which can be detected by optical telescopes. But ZTF SLRN-2020 turned out to have much cooler gas and dust clouds surrounding the star, so De and colleagues started to search for different explanations.

The astronomers then used data provided by the Neowise space telescope, which can scan the entire sky in infrared light much like the recently launched James Webb Space Telescope. Neowise makes a new sky map every six months, giving scientists the ability to see how celestial objects and phenomena change over time.

De discovered that the ZTF SLRN-2020 star brightened almost a year before the flash of light spotted by the ZTF observatory. This was evidence of dust, which emits infrared light, forming around the star. Astronomers now think the "infrared transient" event was a planet being engulfed, consumed and ultimately shredded by the star.

The planet had a size roughly on par with Jupiter, the scientists say, and it had an orbit even closer to its star than Mercury's is to the Sun. The gas giant went down with a fight, the astronomers suggest, as it stripped some gas from the star's surface while it was being dragged down by its unavoidable gravity attraction. The gas was eventually ejected in space, cooling down and turning into dust – like water becoming snow, NASA explains.

The collision between the star and the dying, crumbling planet eventually produced even more gas, which turned into more dust visible through the ZTF and Neowise observatories. De said that "very few things in the universe brighten in infrared light and then brighten in optical light at different times." The fact that Neowise saw the star brightening a year before the optical eruption was "critical to figuring out what this event was," the astronomer explained.

The planet-devouring event should be a reminder of our own fate, or at least of the fate of Earth five billion years from now. By then, the Sun will have depleted its nuclear fuel becoming a red giant, erasing Mercury, Venus, and possibly Earth from the universe in the process. The "light show" produced by this ultimate destruction would be much more subtle than ZTF SLRN-2020, De explained, as the aforementioned planets are many times smaller than a gas monster like Jupiter.