BEIJING (Reuters) - China’s largely rubber-stamp parliament formally extended a law banning disrespect of the national anthem on Saturday to cover Hong Kong, a move that critics have said undermined the Chinese-ruled city’s autonomy and freedoms.

China's and Hong Kong's flags are raised during a ceremony marking the 20th anniversary of the city's handover from British to Chinese rule, in Hong Kong July 1, 2017. REUTERS/Damir Sagolj

In the past few years, some Hong Kong football fans have booed the national anthem during World Cup qualifiers and other matches, mirroring protests in the United States where football players knelt during the national anthem, a practice denounced by U.S. President Donald Trump.

China passed a new law in September mandating up to 15 days in police detention for those who mock the “March of the Volunteers” national anthem, a law that also covers the Chinese territories of Hong Kong and Macau but was not immediately given a legal basis for enforcement there.

The National Anthem Law, which went into effect on Oct. 1, has now been included in an annex of Hong Kong’s Basic Law, or mini constitution, state news agency Xinhua said. It will also be included in an annex of Macau’s Basic Law, Xinhua reported.

He Shaoren, spokesman for the National People’s Congress Standing Committee, said in a news conference on Saturday that it was up to the Hong Kong government to enact a local law to abide by the amendment in a timely manner.

A Hong Kong official said on Wednesday that the Special Administrative Region would enact such a law “as soon as possible”.

Hong Kong is a former British colony that returned to Chinese rule in 1997 under a so-called “one country, two systems” formula that promises the city a high degree of autonomy, including an independent judiciary.

China’s growing reach into Hong Kong’s affairs has, however, stoked tensions and mass protests including the 2014 “Occupy” civil disobedience movement that blocked major roads in the city for 79 days to pressure China to allow full democracy.

Chinese authorities have strived to instil greater patriotism into Hong Kong, while condemning a push from democracy activists to distance Hong Kong.

China’s national legislature on Saturday also passed an amendment to its criminal law that extends punishments for publicly desecrating the national flag and emblem to disrespecting the national anthem. Punishments include jail terms of up to three years, Xinhua reported. This law does not appear to apply to Hong Kong or Macau.