Scientists studying the origin of cosmic rays that bombard the Earth from the heavens have been perplexed for half a century. Now they may finally have an answer - and it’s intergalactic.

The mysterious high-energy rays are radiation consisting of protons and the nuclei of atoms such as hydrogen and iron. It’s also quite rare for them to reach Earth, even traveling at just under the speed of light.

So rare are they, that only about one per square kilometer per year strikes our planet, and as such, a giant observatory is needed to detect them. That’s where the Pierre Auger Observatory comes in.

The collaboration of over 400 scientists from 18 countries centers around the observatory, the largest cosmic ray detector ever built. The massive complex in Argentina covers an area of 3,000 square km and houses an impressive 1,600 detectors that spot the rays when they hit the atmosphere.

Cosmic ray mystery: Largest ever data sample sheds no light on origin https://t.co/2P4UT63I39#FermiTelescope — RT (@RT_com) March 4, 2017

Over the last 12 years, the team has detected over 30,000 rays, and upon studying the data they noticed something strange. Their findings, published Friday in the journal Science, point to the origin of the rays - literally, somewhere in a galaxy far, far away.

The team say they observed an uneven pattern of the the direction of the rays arrival to Earth, with an excess coming from a direction where the density of galaxies other than the Milky Way is relatively high.

“This clearly indicates an origin of particles outside of the Milky Way and is a very exciting outcome; the result of years of careful work with a highly tuned giant detector,”said key researcher Professor Bruce Dawson.

Where outside our galaxy they come from is still a mystery, as is how the rays are formed, though the team do have some theories.

“The sources of these particles may be extreme cosmic environments associated with supermassive black holes at the centres of galaxies, or perhaps in massive shocks in colliding galaxies,” said researcher Dr José Bellido

His colleague, Prof Karl-Heinz Kampert, thinks they may be close to some answers.

“We are now considerably closer to solving the mystery of where and how these extraordinary particles are created, a question of great interest to astrophysicists,” Kampert said.

Understanding how cosmic rays are formed could have wide ranging implications, and they really are wide, cracking the enigma could help scientists further understand the composition of galaxies and even how nuclei are formed.