Enough gold, uranium and other heavy elements about equal in mass to all of Earth's oceans likely came to the solar system from the collision of two neutron stars billions of years ago, a new study finds.

If the same event were to happen today, the light from the explosion would outshine the entire night sky, and potentially prove disastrous for life on Earth, according to the new study's researchers.

Recent findings have suggested that much of the gold and other elements heavier than iron on the periodic table was born in the catastrophic aftermath of colliding neutron stars , which are the ultradense cores of stars left behind after supernova explosions.

Related: How Gravitational Waves Led Astronomers to Neutron Star Gold

"The first directly detected neutron-star merger happened 130 million light-years away, which may sound like a large distance, but was much closer than anticipated," study lead author Imre Bartos, an astrophysicist at the University of Florida, Gainesville, told Space.com. "This made me and my colleagues think about how close to us such events might happen. Could they happen near the solar system?"

The researchers analyzed previous data from ancient meteorites whose origins date back to the early solar system, which formed about 4.6 billion years ago. They focused on traces of radioactive isotopes left in the meteorites that a neutron-star collision would have likely produced. (Isotopes of an element have different numbers of neutrons from each other.)

The kind of relatively short-lived radioactive isotopes a neutron-star merger would have generated are no longer present in the solar system. However, previous work deduced what byproducts would have resulted after those isotopes decayed over time. The scientists analyzed the abundances of these byproducts in ancient meteorites in order to deduce when they were created, and thus when their parent isotopes might have entered the solar system. They also developed computer models of the Milky Way to see where a neutron-star collision might have occurred to seed the solar system with these isotopes.

The researchers found a vast amount of heavy elements in the solar system likely originated from a single neutron-star collision that occurred about 80 million years before the birth of the solar system. Based on the amount of material from this merger that managed to make it here, they suggested this merger happened about 1,000 light-years from the cloud of gas and dust that eventually formed the solar system. (In comparison, the Milky Way galaxy is about 100,000 light-years in diameter.)

"We didn't expect that one event would contribute most of the heavy elements found in the early solar system," Bartos said.

This ancient neutron-star merger would have seeded the solar system with about 1.1 billion billion tons (1 billion billion metric tons) of these heavy elements, such that "in each of us, we would find an eyelash worth of these elements, mostly in the form of iodine, which is essential to life," Bartos said in a statement .

Other phenomena can generate elements heavier than iron on the periodic table, such as the stellar explosions known as supernovas . However, these would generate different patterns of elements than seen in ancient meteorites, Bartos said.

If this neutron-star merger were to happen today at the same distance from Earth, the researchers found that at the very least "it would be brighter than all the night sky put together — as bright as the crescent moon, squeezed into one point," Bartos said. "It would be bright enough to be seen during daytime, brighter than anything but the sun. It would have lasted about a week."

However, if Earth had the misfortune to face either pole of the black hole that resulted from this neutron-star collision, it would prove a disaster. Soon after the merger occurred, a giant explosion known as a gamma-ray burst would erupt from the poles of the newborn black hole. Although it would last only about a second, "the gamma-ray burst would emit more energy than the sun will radiate during its entire lifetime," Bartos said.

If the gamma-rays from such an outburst were to hit Earth, they would get absorbed by the upper atmosphere, generating ultraviolet rays. "A nearby gamma-ray burst would result in a mass extinction," Bartos said. "Luckily, neutron-star mergers only happen roughly every 100,000 years in the Milky Way, and ones that happen nearby do so less often, so we are not in any immediate danger in any way."

The scientists now want to investigate how often neutron-star mergers occurred in the past in the Milky Way "and understand how they influenced the evolution of the galaxy," Bartos said.

Bartos and his colleague Szabolcs Marka at Columbia University in New York detailed their findings online May 1 in the journal Nature.