On June 3, 3.9 billion light-years away, two incredibly dense neutron stars— bodies that are each about 1.5 times the mass of the sun but just the size of mere cities—collided. Scientists studying the event say it solves an enduring mystery about the formation of elements in our universe.

“It's a very fast, catastrophic, extremely energetic type of explosion,” says Edo Berger, an astronomer at the Harvard-Smithsonian Center for Astrophysics. The massive collision released a powerful jet of gamma-rays across the universe. The flash, which lasted for only two-tenths of a second, was picked up by NASA’s Swift satellite and sent astronomers scrambling to collect data.

Over the next few days, telescopes in Chile and the Hubble Space Telescope turned their attention to that region of space. Today, Berger and colleagues announced at a press conference in Cambridge, Massachusetts, that their analysis reveals that neutron star collisions are responsible for the formation of virtually all the heavy elements in the universe—a list that includes gold, mercury, lead, platinum and more.

“This question of where elements like gold come from has been around for a long time,” Berger says. Though many scientists had long argued that supernova explosions were the source, he says his team—which includes Wen-fai Fong and Ryan Chornock of the Harvard astronomy department—have evidence that supernovas aren’t necessary. These neutron star collisions produce all elements heavier than iron, he says, “and they do it efficiently enough that they can account for all the gold that's been produced in the universe.”

Such collisions occur when both the stars in a binary system separately explode as supernovas, and then collapse into themselves, leaving behind a pair of tightly bound neutron stars. As they circle each other, the stars are gradually pulled together by gravitational forces, until they collide.

“They're extremely dense—essentially bullets flying at each other at about ten percent the speed of light,” Berger says. The resulting collision brings together so much mass in one location that it collapses on itself, triggering the formation of a black hole. A small amount of matter, though, gets thrown outward, and is eventually incorporated into the next generation of stars and planets elsewhere in the surrounding galaxy. Close observation of this latest neutron star collision has revealed the contents of this ejected matter.

As the black hole formed, Berger says, it released a gamma-ray burst coded as GRB (gamma-ray burst) 130603B. Within minutes, instruments in Chile searched for further evidence of the collision and found a brief “afterglow” of visible light, generated by the particles thrown off from the explosion that slam into the surrounding environment. This provided astronomers with the exact location and distance of the event, and the fact that the collision occurred relatively close by—at least in astronomical terms—raised hopes that there’d be the chance to collect new sorts of data that were previously unavailable.

On June 12, the Hubble telescope, trained on this location, detected a distinct emission of infrared light, a signal separate from the first explosion. The infrared signature, Berger says, resulted from the radioactive decay of exotic heavy elements (such as uranium and plutonium) formed during the collision and ejected outward. Because of the way that heavy elements form, gold must have formed too. “The total amount of these heavy elements produced was about one percent the mass of the sun,” he notes. “Gold, in that distribution, is about 10 parts per million—so that comes out to about ten times the mass of the moon in gold alone.”

Because the team knows how often these collisions occur, and can now infer roughly how much material is generated with each event, they can compare the total amount of heavy elements produced by neutron star collisions with the known amount in the universe. The team’s conclusion, which was also published today in The Astrophysical Journal Letters, is that these events are a sufficient explanation for all of our heavy elements, including gold. After it’s created in these sorts of collisions and ejected outward, the heavy elements are eventually incorporated into the formation of future stars and planets. Which means that all the gold on Earth, even the gold in your wedding ring, probably comes from the collision of two distant stars.

The new finding also solves a related question: Whether this particular sort of gamma-ray emission—called a “short duration” burst—can be definitively linked with the collisions of two neutron stars. “We’d collected quite a lot of circumstantial evidence suggesting that they come from the collision of two neutron stars, but we’d really lacked a clear ‘smoking gun’ signature,” Berger says. “This event provides, for the first time, that ‘smoking gun.’”

Over the next few years, the Harvard-Smithsonian team and others will continue searching for neutron star collisions so further data can be collected and analyzed. Already, though, having such a rare event (in the Milky Way, they happen once roughly every 100,000 years) occur at a distance close enough for these sorts of observations is quite fortuitous. “I've spent the last decade of my life trying to address the question of gamma-ray bursts, painstakingly collecting evidence and waiting for that one big event,” Berger says. “It’s so satisfying to finally get that evidence that can tell us what’s going on in a more definitive way.”