On the night of March 11, 1437 A.D., in what is now modern-day Seoul, a new star appeared in the sky, seemingly out of nowhere. The newcomer shone for 14 days before fading into the darkness. Korean astronomers noted the mysterious star and its brief stint in the sky in their records. Centuries later, modern astronomers studying these records determined that what the Koreans had seen was a cosmic explosion called a nova. Novae occur in two-star systems, when a dead star, known as a white dwarf, starts eating away at its companion, a star like our sun. The white dwarf slowly builds a layer of hydrogen stolen from the other star over tens of thousands of years, and then ejects it all at once, producing an eruption of light 300,000 times brighter than the sun that can last for weeks.

Michael Shara and his researcher colleagues have spent the last nearly 30 years looking for the star responsible for this nova. In a new paper published Wednesday in Nature, they say they’ve finally found it.

“It’s been like searching for a needle in a billion haystacks,” Shara said.

For most of their search, Shara, a curator in the American Museum of Natural History’s department of astrophysics; Richard Stephenson, a historian of ancient astronomical records at Durham University; and Mike Bode, an astrophysicist at Liverpool John Moores University, focused on a part of the sky where they suspected the mystery star must lurk. The investigation was an on-again, off-again effort of “failure after failure after failure,” one that they returned to when they had the time or a lead.

Last year, Shara found some relevant files in his office that he hadn’t looked at in nearly a decade, and decided to expand the search area in the sky. He started combing through digital databases of stars, looking for any interesting targets. In one astronomical catalog, he saw a well-known planetary nebula, a glowing shell of gas and dust. In a different catalog, he found an image of a binary star taken in 2016 in the same area. Then it hit him: That wasn’t a planetary nebula. It was the leftover shell of a nova explosion, floating near the star system that produced it.

“One the one hand, I was pretty ecstatic,” Shara said of this moment. “On the other hand, I was sort of pounding my forehead a little bit with the back of my hand like, oh my god, I could have found this decades ago, if I had just expanded the search a little bit.”

Shara knew if he could find other images of this star from decades ago and compare it to this newfound photo, he could track its movement over time, rewind the clock, and determine its position nearly 600 years ago, when the Korean astronomers made their observations. Photographs from the 1980s and 1990s showed the star had indeed moved between then and now, but not enough for the researchers to accurately calculate its position in the 15th century. So they looked further back in time, at a photographic plate from 1923 they got through a Harvard project to digitize a century’s worth of sky observations. They measured how much the star moved in the last century, and extrapolated that to five more centuries. As they rewound the clock, the star moved closer to the nova shell. According to their calculations, the star was right in the center of the nova shell on the day the Koreans saw a mystery star, which means it caused the cosmic explosion.

Shara kept up his search for decades because he wanted to confirm a theory on nova explosions he wrote in 1986, when he was working at the Space-Telescope Science Institute at Johns Hopkins. After a classical nova, the process starts all over again. The white dwarf begins again to chip away at its companion. Smaller explosions, known as dwarf novae, may occur as it gathers its fellow star’s material. Eventually, there’s enough stolen material to produce another full-sized nova. Shara posited that dwarf novae and full-sized novae are the same systems, seen at different times, rather than entirely separate objects, as some astronomers have suggested. Now, the search has paid off. Shara found that the star system responsible for the nova in 1437 A.D. shows dwarf novae in photos from the 1930s and 1940s, which supports his claim that both phenomena originate from a single source.

Shara said he and his colleagues couldn’t have investigated this mystery without online astronomical catalogs, which weren’t around in the 1980s. The catalogs are like Google search engines for hundreds of millions of stars.

“If huge databases had existed then, I would have unraveled it right then and there,” he said. “It was only because of this ability to check something like a million astronomical papers and books and many petabytes of images, all within a few minutes, and correlate things with each other that I was able to find this.”