Billions of years in the future, our dead sun will morph into a giant cosmic jewel, a new study suggests.

Like the vast majority of stars in our Milky Way galaxy, the sun will eventually collapse into a white dwarf, an exotic object about 200,000 times denser than Earth. To put that in perspective: A mere teaspoon of white-dwarf material would weigh about as much as an elephant, if you could somehow transport the stuff to our planet.

Half a century ago, theorists predicted that white dwarfs solidify into crystal over time — and the new research has found that this is indeed the case. [Death of a Sunlike Star: How It Will Destroy Earth (Infographic)]

"All white dwarfs will crystallize at some point in their evolution, although more massive white dwarfs go through the process sooner," study lead author Pier-Emmanuel Tremblay, a physicist at the University of Warwick in England, said in a statement.

"This means that billions of white dwarfs in our galaxy have already completed the process and are essentially crystal spheres in the sky," Tremblay added. "The sun itself will become a crystal white dwarf in about 10 billion years."

Tremblay and his colleagues analyzed data gathered by the European Space Agency's Gaia spacecraft, which launched in December 2013 to help researchers construct the best-ever 3D map of the Milky Way. Gaia does this by precisely monitoring the positions of huge numbers of stars; the mission team aims to study 1 billion stars over the spacecraft's operational lifetime.

For the new study, the researchers looked at Gaia measurements of about 15,000 white dwarfs, all of which lie within 330 light-years of the sun. These data revealed an odd "pileup" — an overabundance of white dwarfs with certain colors and brightnesses that cannot be explained by the objects' ages or masses.

Modeling work suggested that the pileup was caused by crystallization of the white dwarfs' interiors, which released enough heat to slow down the white dwarfs' cooling over time.

"This is the first direct evidence that white dwarfs crystallize, or transition from liquid to solid," Tremblay said. "It was predicted 50 years ago that we should observe a pileup in the number of white dwarfs at certain luminosities and colors due to crystallization, and only now this has been observed."

White-dwarf crystallization is akin to water freezing from liquid to ice. But the material in this case is oxygen and carbon, and it's crystallizing at temperatures that aren't exactly chilly. The process really kicks into gear when a white-dwarf interior cools down to about 18 million degrees Fahrenheit (10 million degrees Celsius), the researchers said.

The result is likely a core composed of crystallized oxygen and a mantle dominated by carbon.

"Not only do we have evidence of heat release upon solidification, but considerably more energy release is needed to explain the observations," Tremblay said. "We believe this is due to the oxygen crystallizing first and then sinking to the core, a process similar to sedimentation on a riverbed on Earth. This will push the carbon upward, and that separation will release gravitational energy."

The new results suggest that many white dwarfs are considerably older than scientists had thought — up to 15 percent older in some cases, study team members said. Astronomers generally age these stellar corpses by taking their temperature, and crystallization slows the cooling-off process.

The study was published online today (Jan. 9) in the journal Nature.

Mike Wall's book about the search for alien life, "Out There" (Grand Central Publishing, 2018; illustrated by Karl Tate) is out now. Follow him on Twitter @michaeldwall. Follow us @Spacedotcom or Facebook. Originally published on Space.com.