About 1,500 light years away lies the remnant of a star that was once like our own, and it's providing astronomers with clues as to what might happen in our solar system after the sun dies.

In roughly six billion years, after it has run out of energy, the sun will swell, enveloping Mercury, Venus, and possibly Earth. It will then leave behind a small, hot star, slightly larger than Earth, known as a white dwarf.

Astronomers have discovered an unusual pair: a white dwarf, called WDJ0914+1914, with a giant Neptune-like planet in its orbit. It is the first time such a large planet has been found in such a tight orbit around a white dwarf.

But this star isn't the life-giving companion our sun is to us; it's stripping away the giant planet's atmosphere.

An animation shows the white dwarf and its much larger, Neptune-like planet.

Astronomers had theorized that what might reside around a white dwarf would be more terrestrial-like planets (think Earth and Mars) or even asteroids — not a gas giant like the one they found.

"It's quite a unique system so far," said Boris Gansicke, an astronomer from the University of Warwick in the U.K. and lead author of the study published in Nature . "But we hope to find additional systems in the future."

The planet is believed to be at least twice as large as the star, which it orbits once every 10 days.

Because of its close proximity to the searing hot white dwarf — which is roughly 28,000 C, or five times the temperature of the sun — most of the planet's atmosphere is being swept away. Some of it is pulled into a disk that eventually swirls into the star, at a rate of about 3,000 tonnes per second.

It was this disk that tipped off astronomers to the giant planet's presence.

Chance finding

The team of astronomers found it after poring over data of more than 7,000 white dwarfs observed by the Sloan Digital Sky Survey in Sunspot, New Mexico

One particular star stood out from the rest.

Data revealed quantities of hydrogen, oxygen and sulphur in the star — elements that shouldn't be there, given the star had shed its outer core.

Co-author Nicola Gentile set aside the observations, believing it could be evidence of a binary system that contained a second star that hadn't shed its core.

Gansicke said he looked at the data and realized there were traces of oxygen that he'd never seen before in a binary system.

"I said it was very unlikely to be a white dwarf binary system."

The team then used the X-shooter instrument on the European Southern Observatory's Very Large Telescope in Atacama, Chile, to conduct followup observations. Astronomers were able to take a better look at the star's spectrum, which is the light it emits separated into individual colours.

Observing a spectrum also reveals the elements contained in a star , such as hydrogen, helium, oxygen and more.

The findings suggested that a giant, Neptune-like planet was in close orbit. It was the only logical explanation why hydrogen, oxygen and sulphur were present in the disc.

An artist's animation shows what happens when the Sun runs out of energy

But the planet wouldn't have always been that close to the star. The star would have likely swelled and swallowed up any inner planets that might have existed. The remaining planet was likely knocked into a closer orbit by another planet, Gansicke said. That second planet might even still be in orbit.

Eventually, the white dwarf will cool and much less of the atmosphere will be stripped from the Neptune-like planet.

Eve Lee, an assistant professor in McGill University's physics department, is intrigued by the findings.

"It tells us about the future possibility of how our solar system will look," she said.

It also sheds light on different stellar systems and their possible planets.

"We know stars evolve and they come in many different varieties," Lee said. "It is interesting to look at what is the evolution of the planet in tandem with the evolution of the star."

And there are likely more discoveries to come from this distant stellar system.

Gansicke said the team has been awarded time with the Hubble Space Telescope. He said it would be interesting to see if the planet produces a comet-like tail, with gases escaping into space as it orbits the star.

They also hope to use observations from the Gaia spacecraft, which has identified 260,000 white dwarfs that could potentially reveal similar systems.

Lee says the findings provide new direction for exoplanet research.

"It's not just about finding aliens ... and not just about finding small planets around small stars," she said. "We need to look more broadly."