The death of a massive star has to be one of the most beautiful endings in the Universe.

They eject colossal quantities of material into the space around them, carved out by explosion shockwaves and stellar winds, illuminated by the star's own light. That's what's happening with AG Carinae, a dying massive star 15,000 light-years away, showcased in new Hubble images.

In fact, AG Carinae's death throes are wilder than most. It's what we classify as a luminous blue variable star, which are some of the brightest, most massive stars in the galaxy.

These extremely rare stars burn hot and bright (blue), and their lifespans are much shorter than those of others – just a scant few million years.

AG Carinae, which clocks in at about 55 to 70 times the mass of the Sun, is a few million years old, and unstable. Its brightness fluctuates quite significantly, due to warring forces: the radiation pressure that pushes outward, and the gravity that wants to collapse the star inward.

ag carinae composite(ESA/Hubble and NASA, A. Nota, C. Britt)

At the end of a star's life, as it begins to run out of fuel to fuse into hydrogen, radiation pressure starts to decrease. This causes the star to contract, with material heating up as it gets closer to the stellar core.

This heating then causes the star to erupt, ejecting material outward. For AG Carinae, the shell of material around it – appearing here like an iris around a pupil – is the product of just such an eruption, taking place around 10,000 years ago, and containing around 15 solar masses' worth of material.

In the Hubble images, the colors represent types of material. The red color represents ionized gas ejected from the star, predominantly hydrogen and nitrogen. The blue color is dust around the star, lit by the star's own light.

The shapes and cavities in the dust are thought to be carved by the star's powerful wind, blowing at speeds up to a million kilometers per hour (670,000 miles per hour).

ag carinae gas(ESA/Hubble and NASA, A. Nota, C. Britt)

This wind is blowing faster than the gas nebula is expanding, about 250,000 kilometers per hour; when the wind catches up, it slams into the gas, pushing it outward and clearing a cavity around the star. The stellar wind also carves out the bubbles and filaments seen in the dust.

AG Carinae is still unstable, and will likely eventually become so depleted of hydrogen through repeated outbursts that it evolves into a Wolf-Rayet star; that process is already underway. Once this evolutionary stage of the star's life runs out of fuel, AG Carinae will – probably – end its main sequence days in a supernova.

During this process, astronomers believe the core will collapse, leaving behind one of the most enigmatic objects in the Universe, a black hole.

You can download wallpaper-sized versions of the composite image on the ESA Hubble website.