The year was 1977, and French producer Jacques Morali’s newly-formed band—a stereotype-busting ensemble called “The Village People”—was off to a flying start. Sales of their first album had exceeded every expectation and a second was in the works, complete with an iconic single called “Macho Man.”

One day, the French-born Morali encountered something he’d never seen back in Europe: the Young Men’s Christian Association. After visiting a “Y” on Manhattan’s 23rd Street, Morali realized that this chain of establishments might make terrific Village People fodder. As fate would have it, the group’s third album, Cruisin’ (1978), wound up running short, and a quick filler was needed. So, as David “The Construction Worker” Hodo recalls, “Jacques wrote ‘Y.M.C.A.’ in about 20 minutes—the melody, the chorus, the outline. Then he gave it to [lead singer] Victor Willis and said, ‘Fill in the rest.’ I was a bit skeptical about some of our hits, but the minute I heard ‘Y.M.C.A.,’ I knew we had something special. Because it sounded like a commercial. And everyone likes commercials.”

Everyone also liked “Y.M.C.A.”—except the actual organization. Morali’s upbeat song spent 26 weeks on the Billboard Hot 100 chart, reaching its number 2 slot in 1979. Yet, to a degree, this success irked real-life Young Men’s Christian Association officials.

Y execs didn’t, as some believe, take issue with the Village People’s pro-gay themes or large LGBT fan base (at least, not publicly). Copyright infringement, on the other hand, was a real bone of contention.

Shortly after the single’s debut, the Y.M.C.A. pointed out that its trademarked name had been used without permission, and started seeking what communications director Joe Pisarro described as an “amicable” out-of-court settlement. Reportedly, the Association harbored no interest in profiting from their eponymous hit—though, as one Y.M.C.A. attorney admitted, “In any negotiation, money is a factor.”

What happened next is unclear, but, eventually, both parties made peace and the Y changed its tune. “We at the YMCA celebrate the song,” said media relations manager Leah Pouw back in 2008, “It’s a positive statement about the YMCA and what we offer to people all around the world.” 1999 even saw the Village People visit an actual London-based Y, where they signed a guitar shaped like the Y.M.C.A. logo.