Ruling also means the song can no longer be disseminated or reproduced on internet-based platforms.

An appeals court in Hong Kong has banned a popular song that was penned during the Chinese territory’s pro-democracy protests of 2019.

The ban on Glory to Hong Kong, issued on Wednesday, came as the territory’s authorities sought to remove the song from internet search results and content-sharing platforms.

The popular song incorporates defiant lyrics, including the key protest slogan “Liberate Hong Kong, revolution of our times”. It was later mistakenly played as Hong Kong’s anthem at international sporting events, instead of China’s “March of the Volunteers”, in mix-ups that upset city officials.

Judge Jeremy Poon, ruling in favour of Hong Kong’s government, wrote on Wednesday that the song’s composer “intended it to be a ‘weapon’ and so it had become”. The song has been used as “an impetus to propel the violent protests plaguing Hong Kong since 2019,” he said, pointing to its power in “arousing emotions among certain fractions of the society”.

He said an injunction was necessary to stop a range of acts, including broadcasting and performing the song “with criminal intent”, as well as to persuade internet platform operators to remove “the problematic videos in connection with the song” from their platforms.

The ban would target anyone who broadcast or distributed the song to advocate for the separation of Hong Kong from China. It would also prohibit any actions using the song to misrepresent it as the national anthem with the intent to insult the anthem. But it would exempt lawful journalistic and academic activities.

Critics have said prohibiting the broadcast or distribution of the song further reduces freedom of expression since China cracked down on Hong Kong protests in 2019.

They have also warned the ban might disrupt the operation of tech giants and hurt the city’s appeal as a business centre.

As of midafternoon on Wednesday, Glory to Hong Kong, whose artist is credited as “Thomas and the Hong Kong People”, was still available on Spotify and Apple Music in English and Cantonese. A search on YouTube for the song also displayed multiple videos and renditions.

Google, Spotify and Apple did not immediately comment.

The Hong Kong government went to court last year after Google resisted pressure to display China’s national anthem as the top result in searches for the city’s anthem instead of the protest song. But a lower court rejected the government’s initial bid last July.

In its appeal, the government argued that if the executive authority considered a measure necessary, the court should allow it, unless it considered it would have no effect, according to a legal document on the government’s website.

The government had already asked schools to ban the protest song on campuses.

It previously said it respected freedoms protected by the city’s constitution, “but freedom of speech is not absolute”.