China has a huge population to draw from and its teams have been successful in several sports. But its men’s soccer teams have routinely struggled in international competition.

In 1985, Hong Kong beat China, 2-1, in Beijing to eliminate the team from qualifying for the following year’s World Cup, setting off a riot. In the 2015 World Cup qualifiers, Hong Kong tied China twice. To add to the insult, the home fans booed the Chinese national anthem before the game in Hong Kong.

The world governing body for soccer, FIFA, fined the Hong Kong Football Association for fans booing during one of the China matches and also during a 2015 World Cup qualifier against Qatar. The city’s football association has called on fans to behave, and stewards make vain attempts to encourage hard-core supporters to keep quiet during the national anthem.

The anthem, “March of the Volunteers,” was a poem set to music in 1935, and it became popular as a call for resistance against Japan. Its lyricist, Tian Han, died in prison during the Cultural Revolution in 1968.

The anthem law went into effect on Oct. 1. But Hong Kong, a former British colony, maintains a semiautonomous existence that allows it to keep its own economic and legal systems. So Hong Kong will need to enact its own version of the law, which it has yet to do.

Thus far, Hong Kong fans are unbowed.

“We do it spontaneously because we don’t think we are part of the P.R.C.,” said Sanho Chung, 24, who was at Tuesday’s game, using an abbreviation for the People’s Republic of China. “We are different.”