Artist's impression of supernova 1993J, which exploded in the galaxy M81. At center is a blue companion star that astronomers found in 2014 using the Hubble Space Telescope.

A star-explosion mystery that puzzled astronomers for more than two decades has finally been solved.

Researchers using data gathered by NASA's Hubble Space Telescope have determined that the supernova SN 1993J — which was first observed in 1993, as its name suggests — occurred because one star nabbed hydrogen from another.

“This is like a crime scene, and we finally identified the robber," study co-author Alex Filippenko, a professor of astronomy at the University of California, Berkeley, said in a statement. "The companion star stole a bunch of hydrogen before the primary star exploded." [Supernova Photos: Great Images of Star Explosions]

One telltale sign that something was unusual came through looking at the composition of SN 1993J, which is a Type IIb supernova — a rare kind of star explosion that has much less hydrogen than typical supernovas do.

Astronomers began searching for the companion star shortly after the discovery of SN 1993J, which is found in the Messier 81 galaxy, about 11 million light-years from Earth. They were unable to find the companion, however, because the supernova zone was so crowded that it was tough to know if they were observing the correct star.

"A binary system is likely required to lose the majority of the primary star’s hydrogen envelope prior to the explosion," said lead author Ori Fox, also of UC Berkeley. "The problem is that, to date, direct observations of the predicted binary companion star have been difficult to obtain since it is so faint relative to the supernova itself."

What eventually turned the tide was combining optical images with Hubble ultraviolet (UV) data to find the spectrum of elements expected to emanate from the companion star. The team plans to examine the system further to find more properties of the companion and to better figure out how stars explode, researchers said.

"We were able to get that UV spectrum with Hubble. This conclusively shows that you have an excess of continuum emission in the UV, even after the light from other stars has been subtracted," said co-author Azalee Bostroem of the Space Telescope Science Institute in Baltimore, Maryland.

While supernovas occur about once every second throughout the cosmos, catching one is a challenge to astronomers. Many of them appear faint because they are far from our planet, or they can be obscured from our view by cosmic dust. This makes predicting star explosions even more of a puzzle for scientists.

The research was published in the July 20 edition of the Astrophysical Journal.

Follow Elizabeth Howell @howellspace, or Space.com @Spacedotcom. We're also on Facebook and Google+. Originally published on Space.com.