No one is writing its obituary just yet, but scientists have long known that the sun will die — and now we know what will happen next.

New research by an international team of astronomers shows that once it exhausts its hydrogen fuel in 5 billion years or so, our host star will morph into an enormous ring of glowing dust and gas — what astronomers call a planetary nebula.

"Planetary nebulae are among the prettiest objects in the night sky," Dr. Albert Zijlstra, a professor of astrophysics at the University of Manchester in England and a member of the team, told NBC News MACH in an email. "It is nice to know that the sun will, one day, also make one, even if we won't be around to enjoy it!"

Zijlstra said the nebula will form out of an "envelope" of dust and gas ejected by the dying sun, which by then will have swollen to become a red giant that extends all the way out to the orbit of Venus and perhaps beyond. After the ejection, what's left of the sun will heat up while shrinking down into a white dwarf roughly the size of Earth but much denser.

The NASA Hubble Space Telescope captured this view of the most famous of all planetary nebulae: the Ring Nebula (M57). In this October 1998 image, the telescope has looked down a barrel of gas cast off by a dying star thousands of years ago. JPL-Caltech / NASA

The nebula will be visible for 10,000 to 20,000 years — a blink of an eye on the cosmic timescale. Its gas and dust will slowly disperse, eventually providing the raw material for a new generation of stars and planets.

The new finding, published May 7 in the journal Nature Astronomy, seems to settle a longstanding debate over the sun's distant future.

It's long been known that most stars wind up producing a planetary nebula, but astronomers thought the sun — a ball of superheated gas with a diameter 109 times that of Earth — was too small to form a visible nebula.

"The data said you could get bright planetary nebulae from low mass stars like the sun," Zijlstra said in a written statement. "The models said that was not possible, anything less than about twice the mass of the sun would give a planetary nebula too faint to see."

For their new research, the astronomers created a series of computer models that show how quickly dying stars heat up after ejecting their envelopes. The models indicate that stars heat up three times faster than previous models indicated, showing that there's still enough heat from stars the size of our sun to light up a nebula.

"Our understanding of the sun's fate has ping-ponged back and forth," Dr. Karen Kwitter, an astronomy professor at Williams College in Williamstown, Massachusetts, told MACH in an email, adding that "now, these newest models say that yes, the sun will produce a planetary nebula."

She called the new finding a "'win' for the little guy."

The nebula our sun produces won't be as bright as the ones produced by bigger stars. But as Zijlstra told The Guardian, "If you lived in the Andromeda Galaxy two million light-years away, you'd still be able to see it."

FOLLOW NBC MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.