It’s haunting and mournful and hopeful and beautiful. It’s called “Ashokan Farewell,” and it’s the de facto theme song for the Ken Burns miniseries The Civil War, which premiered 25 years ago this week.

I mean, just listen:

“Ashokan Farewell” was not, as both its tune and the miniseries that made it famous would seem to suggest, written in the 19th century. It was written instead at the tail end of the 20th. And it wasn’t a Southern waltz; it was created in the style of a Scottish lament—and in celebration of a town, and a reservoir, in upstate New York. By a guy from the Bronx.

In the early 1980s, Jay Ungar and his wife and fellow musician, Molly Mason, were running the Ashokan Camp, a summer arts school specializing in fiddle and dancing, at the Ashokan Field Campus of SUNY New Paltz. Ungar composed the tune—Mason would later give it its resonant name—to commemorate the conclusion of the 1982 session of the camp. Ungar had traveled through Scotland earlier in the summer, he told me, and he wanted to compose a tune in the style of a Scottish lament—something that would capture the sense of sadness that the camp, and all the camaraderie and community and joy it represented to him, would be ending.

He wanted something more celebratory, too: “The tune,” he says, “was my attempt to get back to a feeling of connectedness.”

The song, Ungar remembers, “sort of wrote itself.” While “it’s a bit hard to remember now, because it’s been 30 years,” he notes, he does remember that the writing of “Ashokan Farwell” “wasn’t a long process—maybe in the first 20 to 40 minutes, I had most of it.” He experimented on his fiddle. And since “it’s very easy to drift away from your initial inspiration,” he turned on a cassette recorder to make sure his experiments were captured.

“Maybe after an hour or so,” he recalls, “I put it away and then listened.”

Which is not to say that the writing process was strictly a matter of craftsmanship. The emotion that comes through in the final version was there for Ungar, too. “In writing it,” he says, “I was in tears, but I didn’t know why, or what was happening.” There was a kind of “tingling feeling,” he remembers, as the song took shape in his mind and on his fiddle.

But when the song was written down—when Ungar was satisfied that he had made the tune what he wanted it to be—he kept it to himself. He wasn’t sure how others would react to it. But when he was finally ready to share the tune, he was pleasantly surprised: It seemed to affect others as deeply as it had affected him.

And so Ungar and Mason—and their group, Fiddle Fever—recorded the song, including it as part of their 1983 album Waltz of the Wind. The inclusion meant that the song would need a name. Mason suggested “Ashokan Farewell.” Ungar liked that. It was simple, but elegantly evocative.

The release of the album generally coincided with the years Ken Burns spent researching and producing The Civil War. In 1984 in particular, Burns was on the lookout for songs that could serve as the soundtrack for the documentary. He heard Fiddle Fever’s album. He heard “Ashokan Farewell.” He got in touch with Ungar and Mason. He asked for permission to use the song in the documentary. They consented. They ended up playing many of the other songs—all of them, save for “Ashokan Farewell,” composed in the 19th century—on the documentary’s lush soundtrack.

For Ungar, the fact that “a Scottish lament written by a Jewish guy from the Bronx” would become the de facto anthem of The Civil War—and, by extension, of the Civil War itself—makes a certain amount of sense. “The music had connected us to our past in important ways,” he says; it was “a living thing.” And you could say the same thing about The Civil War, which leveraged that quintessential medium of the 20th century—television—to tell the story of that quintessential event of the 19th. The Civil War, in the end, was 11 hours long; nearly an hour of that time—59 minutes and 33 seconds—features some version of “Ashokan Farewell.”

Which helped to ensure that the tune would become, like the series that propelled it to fame, an instant classic. It got played at concerts. It got covered on fiddle and flute and piano and acoustic guitar and electric. Oh, and on the theremin. There’s a polka version of it.

What does Ungar think of all those covers—and of the fact that many people who love the song have no idea about its contemporary origins? “I love it,” Ungar says. “I think it’s a great thing. Most people who record it will tend to stay very, very close to the original. They treat it almost like it’s sacred.”