A composer named Thomas, who has not shared his last name, first posted an instrumental version and lyrics on Aug. 26 to LIHKG, a forum used by protesters, and asked others to record themselves singing it. He collected audio versions via Google Drive, and assembled them together to make it sound as though a choir were singing. He adjusted the lyrics based on suggestions in the forum.

The song was then uploaded on YouTube on Aug. 31 with English subtitles and rousing scenes from demonstrations, such as crowds parting for an ambulance, a child leading chants and a banner hung on a mountain. The composer recruited video editors and musicians to create new versions.

Singing has been part of the demonstrations since they began: The “Les Misérables” hit “Do You Hear the People Sing?” and renditions of “Sing Hallelujah to the Lord,” a 1974 hymn by the American composer Linda Stassen, have been the most popular.

And it’s not the first music to rise out of Hong Kong’s protests. Protesters have long belted “Boundless Oceans, Vast Skies,” a Cantonese-language rock song by the band Beyond, in pro-democracy rallies. In 2014, “Raise the Umbrella,” a collaboration of several Cantopop stars, became the unofficial anthem of the Umbrella Movement, a monthslong pro-democracy demonstration. The song was voted Hong Kong’s favorite of that year.

Lo Hiu Pan, who composed “Raise the Umbrella,” said on Thursday that while his song benefited from the work with celebrity singers, a new song did not have to be a poppy ballad fit for the mainstream to become popular in Hong Kong. Just speaking to the political experience of the moment is enough to catch fire and connect people, he said, adding that he thought “Glory to Hong Kong” was “powerful.”

“Sometimes a photo, comic or a song can spread out the message even more usefully than a long article,” he said.